Jiew Meng
Jiew Meng

Reputation: 88217

C#: Can I have no entry point for a Project?

I am creating a C#/WPF project mainly for providing dialogs for use in other projects. I originally have an app.config but deleted it as the project is meant to be more like a library. I then got the errors

Metadata file 'D:\projects\SimpleColorPicker\SimpleColorPicker\bin\Debug\SimpleColorPicker.exe' could not be found

\SimpleColorPicker.exe' does not contain a static 'Main' method suitable for an entry point D:\projects\SimpleColorPicker\SimpleColorPicker\CSC

How can I fix this? I could leave the app.config in but I thought it will be neater to clean unneeded stuff

Upvotes: 3

Views: 1040

Answers (2)

skaz
skaz

Reputation: 22580

You will need to change your project from a Windows/Console Application to a Class Library in the Project Properties on the Application tab. Then you won't be able to "run" this project in isolation, but if it is a library project then that is what you want.

Upvotes: 1

Jörgen Sigvardsson
Jörgen Sigvardsson

Reputation: 4887

You should create a class library (DLL) rather than an application. A DLL assembly is basically an executable without an entry point. Take a look at the output type in the project properties.

Upvotes: 5

Related Questions