简体   繁体   English

ClickOnce和XNA问题

[英]ClickOnce & XNA issues

I essentially have a blank XNA project built using the XNA 3.1 wizard, i'm testing whether a game i make can be "installed" on another computer without having to make them install everything manually to make it work. 我本质上是使用XNA 3.1向导构建的空白XNA项目,我正在测试是否可以将我制作的游戏“安装”到另一台计算机上,而不必让他们手动安装所有工具以使其正常运行。

The only additional code in the game is: 游戏中唯一的附加代码是:

Components.Add(new GamerServicesComponent(this));

After going through the ClickOnce publishing stage i copied it to a USB drive and attempted to run the "setup.exe" on a Windows Vista computer with no Visual C#/Studio or XNA installed. 经过ClickOnce发布阶段后,我将其复制到USB驱动器,并尝试在未安装Visual C#/ Studio或XNA的Windows Vista计算机上运行“ setup.exe”。

According to the MSDN entry the ClickOnce will actually include everything necessary to make the game work on the computer, yet after the installation i get the dreaded "... has stopped working" when i try to run it. 根据MSDN条目,ClickOnce实际上将包括使游戏在计算机上运行所需的一切,但是在安装后,当我尝试运行它时,却出现了可怕的“ ...已停止工作”。

Does anyone know how to get around this? 有谁知道如何解决这个问题? I assumed the reason it says it can be done is because it works. 我认为它说可以做到的原因是因为它有效。

Thanks 谢谢

http://msdn.microsoft.com/en-us/library/bb464156.aspx http://msdn.microsoft.com/en-us/library/bb464156.aspx

Edit: 编辑:

Just noticed that the article states that the Games for Windows - LIVE is not included in the distributable, would this mean if it was included as a component in the XNA game it would cause the crash when i attempt to run it? 刚刚注意到,该文章指出Windows-LIVE游戏未包含在可分发内容中,这是否意味着如果将它作为XNA游戏的组件包含在内,当我尝试运行它时会导致崩溃?

When an application says "has stopped working" for no immediately apparent reason, that's usually a sign that an unhandled exception has occured. 当应用程序没有立即显而易见的原因说“已停止工作”时,通常表明发生了未处理的异常。 Since MSDN states that the GamerServicesComponent class is not available without the XNA Game Studio installed , that seems like the most plausible explanation. 由于MSDN指出,如果未安装XNA Game Studio ,则GamerServicesComponent类不可用 ,这似乎是最合理的解释。

Why is it available, then? 那为什么可用呢? Well, you need something to program up against; 好吧,您需要一些东西来应对; you wouldn't be able to use auto-completion and such if you didn't have the class, because VS wouldn't know what it looked like 如果您没有该类,则将无法使用自动补全功能,因为VS不会知道它的外观

Getting it to compile for, say, XBox 360, where I would guess that the class CAN be used, probably wouldn't work either if it didn't know anything about the class. 例如,让它为XBox 360进行编译,我想可以在其中使用该类,如果它对该类一无所知,则可能也不起作用。

To address the general problem of a ClickOnce application which "has stopped working" immediately, you can get more information on your particular problem by looking in the Windows Event Viewer: http://windows.microsoft.com/en-US/windows-vista/Open-Event-Viewer 要解决ClickOnce应用程序的一般问题,该应用程序“已立即停止工作”,可以通过在Windows事件查看器中查看有关特定问题的更多信息: http : //windows.microsoft.com/zh-CN/windows- VISTA /开事件查看器

Like Michael mentioned, this is often an unhandled exception, but this way you can see WHAT the unhandled exception was. 就像迈克尔提到的那样,这通常是未处理的异常,但是通过这种方式,您可以看到未处理的异常是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM