C# 如何在 Windows 8 中安装 XNA Game Studio 4.0?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12849107/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 00:41:02  来源:igfitidea点击:

How to install the XNA Game Studio 4.0 in Windows 8?

c#visual-studio-2010xnawindows-8xna-4.0

提问by annonymously

This question is related, but NOT a duplicate: How to install XNA game studio on Visual Studio 2012?

这个问题是相关的,但不是重复的:How to install XNA game studio on Visual Studio 2012?

I read the above mentioned post, and have got xna projects opening, but I now have a problem.

我阅读了上面提到的帖子,并打开了 xna 项目,但我现在遇到了问题。

Some of the references to the XNA framework aren't found:

找不到对 XNA 框架的一些引用:

Microsoft.Xna.Framework.Avatar
Microsoft.Xna.Framework.GamerServices
Microsoft.Xna.Framework.Net
Microsoft.Xna.Framework.Storage
Microsoft.Xna.Framework.Video

And all references to Microsoft.Xna.Framework.Content.Pipeline

以及所有对 Microsoft.Xna.Framework.Content.Pipeline

Without these, I can't compile or run any games that I've made. I can't find the dll that contains these, or where I should put them.

没有这些,我就无法编译或运行我制作的任何游戏。我找不到包含这些的 dll,或者我应该把它们放在哪里。

采纳答案by Justin Skiles

UPDATE: March 3, 2014

更新:2014 年 3 月 3 日

Use the download for VS2012 and VS2013 at this link: https://msxna.codeplex.com/releases. I have no idea of the legality on that project (the developers seem to have decompiled XNA), but it did help me ease the pain of needing VS2010 in order to utilize the content pipeline.

在此链接中使用 VS2012 和 VS2013 的下载:https://msxna.codeplex.com/releases 。我不知道该项目的合法性(开发人员似乎已经反编译了 XNA),但它确实帮助我减轻了需要 VS2010 以利用内容管道的痛苦。

Old Answer

旧答案

See: How to work around a possible XNA Game Studio or Windows Phone SDK install failure on Windows 8

请参阅:如何解决 Windows 8 上可能的 XNA Game Studio 或 Windows Phone SDK 安装失败

How to work around this issue

If you run into this issue, here are steps that you can use to work around it:

  • Download and install the latest version of the Games for Windows – LIVE Redistributable from http://www.xbox.com/en-US/LIVE/PC/DownloadClient
  • If you are installing the Windows Phone SDK 7.1, re-run setup and choose to repair it. This will re-run the previously failing XNA Game Studio installers and they should install correctly this time.
  • If you are install a standalone XNA Game Studio product, re-run setup and it should install correctly this time.
  • If you are planning to do Windows Phone development, you should also install the Windows Phone SDK 7.1.1 Update after installing the Windows Phone SDK 7.1. This update fixes an issue that prevents the emulator in the Windows Phone SDK 7.1 from working correctly on Windows 8.

如何解决此问题

如果您遇到此问题,可以使用以下步骤来解决此问题:

  • http://www.xbox.com/en-US/LIVE/PC/DownloadClient下载并安装最新版本的 Windows 游戏 – LIVE Redistributable
  • 如果您正在安装 Windows Phone SDK 7.1,请重新运行安装程序并选择修复它。这将重新运行以前失败的 XNA Game Studio 安装程序,这次它们应该正确安装。
  • 如果您要安装独立的 XNA Game Studio 产品,请重新运行安装程序,这次应该可以正确安装。
  • 如果您计划进行 Windows Phone 开发,则还应在安装 Windows Phone SDK 7.1 后安装 Windows Phone SDK 7.1.1 更新。此更新修复了阻止 Windows Phone SDK 7.1 中的模拟器在 Windows 8 上正常工作的问题。

What to do if the workaround doesn't help

If you have tried the above steps and setup still fails, you are running into a different issue than the one described above, and you will have to look at the setup log files to determine the root cause.

If you are installing the Windows Phone SDK 7.1, you can use the log collection tool to gather your setup log files. This log collection tool will create a file named %temp%\vslogs.cab.

If you are installing XNA Game Studio, you can find log files at the following locations:

  • XNA Game Studio 4.0 Refresh - %temp%\XNA Game Studio 4.0 Setup\Logs
  • XNA Game Studio 4.0 - %temp%\XNA Game Studio 4.0 Setup\Logs
  • XNA Game Studio 3.1 - %temp%\XNA Game Studio 3.1 Setup\Logs
  • XNA Game Studio 3.0 - %temp%\XNA Game Studio 3.0 Setup\Logs
  • XNA Game Studio 2.0 - %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Setup\Logs

如果解决方法不起作用怎么办

如果您已尝试上述步骤但安装仍然失败,则您遇到的问题与上述问题不同,您必须查看安装日志文件以确定根本原因。

如果您正在安装 Windows Phone SDK 7.1,您可以使用日志收集工具来收集您的安装日志文件。此日志收集工具将创建一个名为 %temp%\vslogs.cab 的文件。

如果您正在安装 XNA Game Studio,您可以在以下位置找到日志文件:

  • XNA Game Studio 4.0 刷新 - %temp%\XNA Game Studio 4.0 Setup\Logs
  • XNA Game Studio 4.0 - %temp%\XNA Game Studio 4.0 Setup\Logs
  • XNA Game Studio 3.1 - %temp%\XNA Game Studio 3.1 Setup\Logs
  • XNA Game Studio 3.0 - %temp%\XNA Game Studio 3.0 Setup\Logs
  • XNA Game Studio 2.0 - %ProgramFiles%\Microsoft XNA\XNA Game Studio\v2.0\Setup\Logs

What is causing this failure behind the scenes

XNA Game Studio installs a version of the Games for Windows – LIVE Redistributable behind the scenes. Some older versions of the Games for Windows – LIVE Redistributable attempt to install and use a file that is being installed by Windows 8, and the older versions of the redistributable are not compatible with the newer version of the file that is installed by Windows 8. Newer versions of the Games for Windows – LIVE Redistributable are compatible with Windows 8, and if you pre-install the new redistributable before installing XNA Game Studio, setup will recognize that it is already there and use the new version instead of trying to install the old version.

是什么导致了幕后失败

XNA Game Studio 在幕后安装了一个适用于 Windows 的游戏版本——LIVE Redistributable。某些旧版本的 Games for Windows – LIVE Redistributable 尝试安装和使用 Windows 8 正在安装的文件,并且旧版本的可再发行组件与 Windows 8 安装的较新版本的文件不兼容。较新版本的 Games for Windows – LIVE Redistributable 与 Windows 8 兼容,如果您在安装 XNA Game Studio 之前预先安装了新的可再发行版,安装程序将识别它已经存在并使用新版本而不是尝试安装旧版本。

回答by rareyesdev

The installer for XNA Game Studio 4.0has some issues on Windows 8. The installation process fails and removes all installation files. The fact is that the main installer extracts the following installers (at c:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\Setup):

XNA Game Studio 4.0的安装程序在Windows 8上存在一些问题。安装过程失败并删除所有安装文件。事实上,主安装程序会提取以下安装程序(位于 c:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\Setup):

  • XLiveRedist.msi
  • xnags_documentation.msi
  • xnags_platform_tools.msi
  • xnags_shared.msi
  • xnags_visualstudio.msi
  • xnaliveproxy.msi
  • XLiveRedist.msi
  • xnags_documentation.msi
  • xnags_platform_tools.msi
  • xnags_shared.msi
  • xnags_visualstudio.msi
  • xnaiveproxy.msi

The conflict is with the first one. So if you manually install all others, XNA should work fine. The problem is that after the installation failure this files are automatically deleted. My solution is to halt the installation process (using the task manager) in the moment when an error was detected, this way the installer don't have time to erase the installation files. Once you have the files you can install it without repeating the procees. It worked for me!!!

冲突是与第一个。因此,如果您手动安装所有其他软件,XNA 应该可以正常工作。问题是安装失败后,这些文件会被自动删除。我的解决方案是在检测到错误的那一刻停止安装过程(使用任务管理器),这样安装程序就没有时间清除安装文件。一旦你有了文件,你就可以安装它而无需重复过程。它对我有用!!!