Win Service project won't Build after switching to Any CPU config

后端 未结 2 467

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:

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-05 04:44

    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.

    1. Project > Application > Output type: Class Library
    2. Build - good build, but does not run
    3. Project > Application > Output type: Console Application
    4. Build - good build, code runs

提交回复
热议问题