The program does not contain static "Basic method suitable for entry point

What should I do if I just want to create a project containing many library functions? In other words, the main method is not required. It seems to be compiling a minute ago, and then I added another .cs file, and now I came across this error message.

+6
c #
source share
6 answers

Create a .NET Class library project if you only need a library project. If this is an existing project, you can set the Project Output type to a DLL (Class Library) instead of an executable file (Windows Application / Console Application) in the project properties.

+19
source share

What project did you create? It looks like you wanted to create a class library, but accidentally created an executable assembly. Make sure that you are actually creating an assembly of the class library (that is, ".dll" and not ".exe").

If you are not using Visual Studio and compile your code using csc.exe , make sure you specify /target:library to compile the code into a library.

+4
source share

You want to make the project a class like a library. I believe that you can change the project type in the project properties settings.

+1
source share

or you can use the try-and-true empty main method

0
source share

I have a solution. Really simple. You wrote a static base void with lowercase. You should write like this: static void Main ()

0
source share

This problem occurs when we deleted the App.xaml file from our project after the required method was written because of this, make sure your App.xaml file is in the correct format with the appropriate namespace and links, if it is not, create it and add it to your project.

0
source share

All Articles