Reputation: 44051
What do I do if I just want to create a project which contains a bunch of library functions? 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.
Upvotes: 8
Views: 14829
Reputation: 1
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.
Upvotes: 0
Reputation: 15265
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.
Upvotes: 22
Reputation: 11
I have the solution. Really simple. You wrote the static void main with lower case. You should write it like this: static void Main()
Upvotes: 0
Reputation: 4052
You want to make the project a Class Library type. I believe you can change the type of project in the project properties settings.
Upvotes: 1
Reputation: 351516
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.
Upvotes: 4