Unable to select Target framework for XNA 4.0 games

*爱你&永不变心* 提交于 2019-11-29 19:47:19

问题


I have an XNA 4.0 project that I would like to be compiled with the .Net 4.0 Full profile, but it is set to Client profile by default. The Target framework combobox in the Application tab is grayed out.

I have uninstalled and reinstalled .Net 3.5, .Net 4.0 and Xna 4.0. What could be the problem? Our other development machines do not have this problem.


回答1:


I found a workaround:

In the .csproj file is an xml element called TargetFrameworkProfile which is set to Client. When I remove the word Client and thus empty the xml node, the project is built as a full .Net 4.0 assembly.

You can even upgrade the project to .NET 4.5 or higher by changing the TargetFrameworkVersion element. We use this to be able to use the Kinect One camera in XNA games.

<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>



回答2:


Where do you see that your project is set to the client framework? I created several XNA-projects but never got problems with this.

My Target framework box is disabled too.

If you're getting bugs, I think you've to search for another cause.

Greatings




回答3:


Per Wouter's answer, here is the proper XML in the .csproj file:

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile></TargetFrameworkProfile>


来源:https://stackoverflow.com/questions/6522455/unable-to-select-target-framework-for-xna-4-0-games

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