C# 控制台应用程序无法运行
我正在使用 Visual Studio 2008 Express,并尝试创建一个简单的控制台应用程序来测试它。 当我尝试编译它时,它编译得很好,但是当我尝试运行它时,它抱怨缺少清单文件。 据我所知,VStudio 应该自动创建清单文件,但由于它是一个简单的控制台应用程序,没有任何依赖项,所以我要求 VS 创建没有清单的应用程序。 它没有改变任何事情。 它不断要求提供清单文件,并表示应用程序应该有一个清单文件。 我记得以前 VS Express 版本的 vshost 进程中存在旧错误,因此我尝试禁用它。 当我这样做时,错误消息更改为应用程序无法正确加载并将被关闭,两者都可以选择创建或不创建清单。 我很确定这是我 VS Express 上的一些配置错误,但我找不到具体位置。 有人遇到过类似的问题吗?
I am using Visual Studio 2008 Express and I tried creating a simple console application to test it. When I try to compile it, it compiles fine, but when I try to run it, it complains about the absence of a manifest file. As far as I know, VStudio should create the manifest file automatically, but since it is a simple console application without any dependencies, I asked VS to create the application without a manifest. It didn't change a thing. It kept asking for a manifest file saying that the application was supposed to have one. I remembered old bugs from the vshost process from previous VS Express versions so I tried disabling it. When I did, the error message changed to say that the application failed to load properly and would be closed, both with the option to create a manifest or not. I am pretty sure it is some misconfiguration on VS Express on my part, but I couldn't really find where. Anyone had any similar problems?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你应该只创建清单文件。 设置时间大约为 30 秒,我相信您在谷歌搜索和尝试解决问题上浪费了更多时间。
以下是有关程序集清单的 MSDN 文章(在 .NET 3.5 中):
http:// msdn.microsoft.com/en-us/library/1w45z383.aspx
编辑 & 对于否决此答案的人请注意:这是一个有用的答案,我告诉你原因。 在实施软件项目时,有时我们都会犯错误,并通过尝试以毫无意义的方式做一些事情而浪费大量时间。 能够尽早认识到“我做错了”而不是试图强行采用不可行的解决方案,这是一项非常重要的工程技能。
I think you should just create the manifest file. It's like 30 seconds to set up and I'm sure you have wasted much more time by googling and trying to solve the issue.
Here's the MSDN article about assembly manifests (in .NET 3.5):
http://msdn.microsoft.com/en-us/library/1w45z383.aspx
EDIT & note for the person who downvoted this answer: This is a helpful answer, and I tell you why. When implementing software projects, sometimes we all make mistakes and waste a lot of time by trying do something in a way that just doesn't make sense. It is a very important engineering skill to be able to realize that "I'm doing it wrong" as early as possible and not try to force a non feasible solution.