切换到任何CPU配置后,Win Service项目将无法生成 [英] Win Service project won't Build after switching to Any CPU config

查看:66
本文介绍了切换到任何CPU配置后,Win Service项目将无法生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试解决问题。将我的.net 4.0 C#Win Service项目更改为任何CPU /发行版配置后,出现此编译时错误:

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:

无法指定/主要用于构建模块或库

它将有问题的文件标识为 CSC,生成该文件的项目是我的Service项目(不是我的Service项目)解决方案中附带的代码库)。我已经查看了项目文件和配置编辑器的设置,但仍无法确定问题的根源。

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?

推荐答案

已修复!如果其他人遇到这种奇怪的构建行为,我将提供解决方案。我在MSDN上找到了论坛线程解决了该问题。在项目文件中,我删除了< StartupObject> 标记之间的值,并将其留为空白。现在可以成功构建,而不会出现先前的错误。

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.

这篇关于切换到任何CPU配置后,Win Service项目将无法生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆