How can I work with XNA projects in Visual Studio 11 Beta?

百般思念 提交于 2019-12-31 11:22:24

问题


Visual Studio 11 was released a few weeks back and now that ReSharper is available for it, I'm ready to start using it!

Some of the projects I'm working on are XNA projects. These don't appear to load in VS11 Beta, even after reinstalling XNA Game Studio 4 Refresh after installing VS11 Beta.

Has anyone got VS11 Beta working with XNA projects?


回答1:


I have just gotten it to work, it required some hackery.

This will work after installing XNA Game Studio 4.0.

Find the Game Studio 4.0 directory in:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft

Copy the directory to:

%AppData%\Local\Microsoft\VisualStudio\11.0\Extensions

You can go there in Explorer by entering %AppDatain the address bar, hitting enter, and then navigating or filling out the rest of the address bar (for some reason just pasting the full relative url doesn't work)

Where %AppData% stands for your personal AppData directory. It is a hidden directory in your personal directory which is usually situated in C:\Users\YourUserName.

You are not done, open the directory you just created and open the extension.vsixmanifest file with a texteditor and change this block:

<SupportedProducts>
  <VisualStudio Version="10.0">
    <Edition>VSTS</Edition>
    <Edition>VSTD</Edition>
    <Edition>Pro</Edition>
    <Edition>VCSExpress</Edition>
    <Edition>VPDExpress</Edition>
  </VisualStudio>
</SupportedProducts>

To this:

<SupportedProducts>
  <VisualStudio Version="11.0">
    <Edition>Ultimate</Edition>
    <Edition>Premium</Edition>
    <Edition>Pro</Edition>
  </VisualStudio>
</SupportedProducts>

And save it. Now go up one directory level to the Extensions directory and remove any cache files that are present (don't worry they are automatically regenerated) and restart Visual Studio. You should now be able to open your XNA projects!

edit:

There is now a more popular up to date question here: How to install XNA game studio on Visual Studio 2012?

For me it did not work, the extension only showed up when I installed another extension (I updated nuget), removing caches did not seem to help at all.




回答2:


Note that I haven't tried the beta yet. But I can give you some information that may be relevant.

Historically XNA Game Studio has always been tied to a particular version of Visual Studio. For example XNA 3 only works with VS 2008 and XNA 4 only works with VS 2010.

While you can reference the XNA assemblies in a project in another version of Visual Studio, you cannot use XNA Game Studio features - most notably the Content Pipeline. This means you must create your XNB files some other way, or not use ContentManager. Also the profile setting (HiDef vs Reach) must be set manually, and cross-platform project updating is not available.

I'm not really sure if projects will even load successfully or not; and if they do, whether they will build. If you open up an XNA project file in a text editor, you will notice some MSBuild instructions that the newer Visual Studio may not understand. If you clean out these manually, the project should load.



来源:https://stackoverflow.com/questions/9674758/how-can-i-work-with-xna-projects-in-visual-studio-11-beta

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!