繁体   English   中英

无法在vs2012中打开vs2010 csproj文件

[英]can't open vs2010 csproj file in vs2012

目标:

用winforms做xna。

方式

从此链接中获取代码以及如何从程序员那里获取Microsoft的方式 ,该链接包含一个包含三个项目的解决方案,其中包括表单项目,Content和ContentLibrary项目。

项目说明:

ContentLibrary项目将构建一个dll,供表单项目参考(但似乎没有任何内容,我也不知道为什么)。
它以我从未见过的怪异方式引用Content项目。
Content项目包含一个图片文件,仅此而已,我不知道它是做什么的。
最后,表单项目包含具有许多控件的主表单,这些控件包括用户定义的控件,一个继承xna控件的抽象以及其他实现此控件的控件(这些控件将进行绘制)。

问题:

无法打开ContentLibrary项目。
我收到的错误消息: C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ XNA Game Studio \\ Microsoft.Xna.GameStudio.targets找不到,请确保声明中的路径正确并且磁盘上存在该文件

我的尝试:

用记事本打开ContentLibrary项目文件(.csproj一个),这是我发现的内容:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{396ADBE6-FB16-4DBA-8C70-C16A46B448EA}</ProjectGuid>
<ProjectTypeGuids>{6D335F3A-9D43-41b4-9D22-F6F17C4BE596};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}     </ProjectTypeGuids>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ContentLibrary</RootNamespace>
<AssemblyName>ContentLibrary</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<XnaFrameworkVersion>v4.0</XnaFrameworkVersion>
<XnaPlatform>Windows</XnaPlatform>
<XnaProfile>Reach</XnaProfile>
<XnaCrossPlatformGroupID>e0c073d9-a61b-474a-bda0-a8ada2c89669</XnaCrossPlatformGroupID>
<XnaOutputType>Library</XnaOutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\x86\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;WINDOWS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>x86</PlatformTarget>
<XnaCompressContent>false</XnaCompressContent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\x86\Release</OutputPath>
<DefineConstants>TRACE;WINDOWS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>x86</PlatformTarget>
<XnaCompressContent>true</XnaCompressContent>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Xna.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Game, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Graphics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.GamerServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Xact, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Video, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Avatar, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
  <Private>False</Private>
</Reference>
<Reference Include="Microsoft.Xna.Framework.Storage, Version=4.0.0.0, Culture=neutral, PublicKeyToken=842cf8be1de50553, processorArchitecture=x86">
  <Private>False</Private>
</Reference>
<Reference Include="mscorlib">
  <Private>False</Private>
</Reference>
<Reference Include="System">
  <Private>False</Private>
</Reference>
<Reference Include="System.Xml">
  <Private>False</Private>
</Reference>
<Reference Include="System.Core">
  <RequiredTargetFramework>4.0</RequiredTargetFramework>
  <Private>False</Private>
</Reference>
<Reference Include="System.Xml.Linq">
  <RequiredTargetFramework>4.0</RequiredTargetFramework>
  <Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Content\Content.contentproj">
  <Project>{618DED89-9BA8-44D7-83A0-163041666FAC}</Project>
  <Name>Content</Name>
  <XnaReferenceType>Content</XnaReferenceType>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\Microsoft.Xna.GameStudio.targets" />
<!--
  To modify your build process, add your task inside one of the targets below and uncomment it. 
  Other similar extension points exist, see Microsoft.Common.targets.
  <Target Name="BeforeBuild">
  </Target>
  <Target Name="AfterBuild">
  </Target>
-->
</Project>

可选信息:

如果需要,我正在运行Windows 8 x64。

我在这里找到了解决方案: https : //bitbucket.org/rbwhitaker/xna-beyond-vs-2010/downloads

给定的链接包含一个由PowerShell启动的脚本文件(类似于命令提示符)。 如果运行Windows 7或更高版本,则具有PowerShell,如果不使用此链接,则:
http://www.microsoft.com/zh-cn/download/details.aspx?id=40855

准备就绪后,请执行以下步骤:

  1. 打开PowerShell。
  2. 使用cd命令导航到放置脚本的位置。
  3. 运行以下命令: Set-ExecutionPolicy Unrestricted 这是因为默认情况下,PowerShell不会激活脚本文件来保护您的计算机,您可以在键入以下内容后将其更改回: Set-ExecutionPolicy Restricted
  4. 使用以下命令运行脚本: .\\XnaFor2013.ps1
  5. 等待,这需要一些时间,在我的计算机上花费了大约15分钟。 在较慢的计算机上可能需要更长的时间。 (我有Windows 8 64位。)

如果您想知道此脚本的作用,请向下滚动到页面末尾:
http://rbwhitaker.wikidot.com/setting-up-xna

防止链接腐烂的摘录:

首先,它从Microsoft下载XNA安装程序。

事实证明,XNA安装程序只是一个自解压存档,其中包含大约七个其他安装程序。 因此,脚本要做的下一件事是解压缩那些“内部”安装程序。

七个中的六个完全按照您希望它们执行的操作进行操作,因此脚本依次轮流运行它们。

另一个是将文件放置在Visual Studio中正确位置的安装程序。 不幸的是,它正在寻找Visual Studio 2010,而您拥有的是新版本(2012或2013都可以使用该脚本)。 因此,脚本告诉该安装程序将文件仅放置在一个临时位置。

这些文件是为Visual Studio 2010构建的,需要进行一些更改,因此脚本会进行更改并将其放置在适合您的Visual Studio版本的适当位置。 (实际上,它适用于已安装的所有Visual Studio版本,无论是2012还是2013,也不管是Windows Desktop的付费版本还是Express。)

不幸的是,Visual Studio不会自动检查新的加载项。 (实际上,这是一件好事,因为要花费所有时间检查所有时间,但是在这种情况下,这很不好,因为我们需要对其进行检查。)要使其检查新插件,脚本将删除扩展缓存并包含Visual Studio重建它。 重建缓存将花费脚本运行的大部分时间。 (几分钟。)

重建后,一切准备就绪,脚本将删除其创建的临时文件。

暂无
暂无

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

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