I'm trying to find a fix for my problem. After changing my .net 4.0 C# Win Service project to Any CPU/Release build configuration, I am getting this compile time error:
Cannot specify /main if building a module or library
It identifies the offending file as "CSC" and the project generating it is my Service project (not my accompanying code library in the solution). I've looked through the project file and configuration editor settings yet haven't been able to identify the source to my problem.
Anyone else ever experience this show stopping problem?
Fixed! I'll include the solution in case anyone else comes across this strange build behavior. I found a forum thread on MSDN that had the solution to the problem. In the project file I removed the value between the <StartupObject>
tags and left it blank. Now builds successfully without the previous error.
This fix worked for me by toggling the Output Type. Do not know why, but seems to clear the CS2017 error. Then build works. No changes to code were made.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With