Program does not contain a static ‘Main’ method suitable for an entry point
What do I do if I just want to create a project which contains a bunch of library functions开发者_如何学Go? In other words no Main method is required. It seemed to be compiling a minute ago and then I added another .cs file and now I am confronted with this error message.
Create a .NET Class Library project if you only want a library project. If this is a project that already exists, you can set the Project Output type to a DLL ("Class Library") instead of an Executable ("Windows Application"/"Console Application") in the project properties.
What type of project did you create? It sounds like you meant to create a class library but accidentally created an executable assembly. Ensure that you are in fact creating a class library assembly (i.e. ".dll" not ".exe").
If you aren't using Visual Studio and are compiling your code with csc.exe
then make sure that you are specifying /target:library
to compile your code into a library.
You want to make the project a Class Library type. I believe you can change the type of project in the project properties settings.
or you could use the tried-and-true empty main method
I have the solution. Really simple. You wrote the static void main with lower case. You should write it like this: static void Main()
This problem is occured when we deleted App.xaml
file from our project after the required method written due to that please ensure that your App.xaml
file is in correct format with respective namespace and references, if it is not, create it and add it in your project.
精彩评论