简体   繁体   English

无法在vs2012中打开vs2010 csproj文件

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

Goal: 目标:

doing xna with winforms. 用winforms做xna。

Way 方式

getting the code and how from their programmer, Microsoft from this link , which contains a solution with three projects in it, the form project, the Content and the ContentLibrary project. 从此链接中获取代码以及如何从程序员那里获取Microsoft的方式 ,该链接包含一个包含三个项目的解决方案,其中包括表单项目,Content和ContentLibrary项目。

Projects explanation: 项目说明:

The ContentLibrary project builds a dll which the form project references(but it doesn't seem to have anything and I don't know why). ContentLibrary项目将构建一个dll,供表单项目参考(但似乎没有任何内容,我也不知道为什么)。
It references the Content project in a bizzare way I have never seen. 它以我从未见过的怪异方式引用Content项目。
The Content project contains a picture file, nothing else and I don't know what does it build. Content项目包含一个图片文件,仅此而已,我不知道它是做什么的。
Finally the form project which contains the main form which have many controls including user defined ones, one abstract which inherits xna control, and others to implement this control(these will do the drawing). 最后,表单项目包含具有许多控件的主表单,这些控件包括用户定义的控件,一个继承xna控件的抽象以及其他实现此控件的控件(这些控件将进行绘制)。

Problem: 问题:

could not open the ContentLibrary project. 无法打开ContentLibrary项目。
the error message I get: C:\\Program Files(x86)\\MSBuild\\Microsoft\\XNA Game Studio\\Microsoft.Xna.GameStudio.targets was not found confirm that the path in the declaration is correct and that the file exists on disk 我收到的错误消息: C:\\ Program Files(x86)\\ MSBuild \\ Microsoft \\ XNA Game Studio \\ Microsoft.Xna.GameStudio.targets找不到,请确保声明中的路径正确并且磁盘上存在该文件

My Try: 我的尝试:

opening the ContentLibrary project file(.csproj one) with notepad and here's what I found: 用记事本打开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>

Optional information: 可选信息:

in case needed, I'm running Windows 8 x64. 如果需要,我正在运行Windows 8 x64。

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

The link given contains a script file which is launched by PowerShell(similar to command prompt). 给定的链接包含一个由PowerShell启动的脚本文件(类似于命令提示符)。 If you run Windows 7 or later you have PowerShell, if not use this link: 如果运行Windows 7或更高版本,则具有PowerShell,如果不使用此链接,则:
http://www.microsoft.com/en-us/download/details.aspx?id=40855 http://www.microsoft.com/zh-cn/download/details.aspx?id=40855

When you're ready follow these steps: 准备就绪后,请执行以下步骤:

  1. Open PowerShell. 打开PowerShell。
  2. Navigate to where you put the script by using cd command. 使用cd命令导航到放置脚本的位置。
  3. Run the following command: Set-ExecutionPolicy Unrestricted . 运行以下命令: Set-ExecutionPolicy Unrestricted This is because PowerShell doesn't activate script files by default to protect your computer, you can change it back when finished by typing: Set-ExecutionPolicy Restricted 这是因为默认情况下,PowerShell不会激活脚本文件来保护您的计算机,您可以在键入以下内容后将其更改回: Set-ExecutionPolicy Restricted
  4. Run the script using this command: .\\XnaFor2013.ps1 使用以下命令运行脚本: .\\XnaFor2013.ps1
  5. Wait, it takes some time, on my computer it took about 15 minutes. 等待,这需要一些时间,在我的计算机上花费了大约15分钟。 It may take longer on slower computers. 在较慢的计算机上可能需要更长的时间。 (I had windows 8 64 bit.) (我有Windows 8 64位。)

If you want to know what this script does scroll down to the end of this page: 如果您想知道此脚本的作用,请向下滚动到页面末尾:
http://rbwhitaker.wikidot.com/setting-up-xna http://rbwhitaker.wikidot.com/setting-up-xna

Excerpt to prevent link rot: 防止链接腐烂的摘录:

First, it downloads the XNA installer from Microsoft. 首先,它从Microsoft下载XNA安装程序。

It turns out that the XNA installer is just a self-extracting archive that contains about seven other installers. 事实证明,XNA安装程序只是一个自解压存档,其中包含大约七个其他安装程序。 So the next thing the script does is unpack those "internal" installers. 因此,脚本要做的下一件事是解压缩那些“内部”安装程序。

Six of the seven do exactly what you want them to do, out of the box, so the script runs them each in turn. 七个中的六个完全按照您希望它们执行的操作进行操作,因此脚本依次轮流运行它们。

The other one is the installer that places files in the right place in Visual Studio. 另一个是将文件放置在Visual Studio中正确位置的安装程序。 Unfortunately, it's looking for Visual Studio 2010, while you've got a newer version (2012 or 2013 both work with the script). 不幸的是,它正在寻找Visual Studio 2010,而您拥有的是新版本(2012或2013都可以使用该脚本)。 So the script tells this installer to just place the files in a temporary location. 因此,脚本告诉该安装程序将文件仅放置在一个临时位置。

These files are built for Visual Studio 2010 and require some changes, so the script makes the changes and places them in the appropriate place for your version of Visual Studio. 这些文件是为Visual Studio 2010构建的,需要进行一些更改,因此脚本会进行更改并将其放置在适合您的Visual Studio版本的适当位置。 (In fact, it does it for all versions of Visual Studio you've got installed, regardless of whether it's 2012 or 2013, and regardless of if it's a paid version or Express for Windows Desktop.) (实际上,它适用于已安装的所有Visual Studio版本,无论是2012还是2013,也不管是Windows Desktop的付费版本还是Express。)

Unfortunately, Visual Studio doesn't automatically check for new add-ons. 不幸的是,Visual Studio不会自动检查新的加载项。 (Actually, that's a good thing because it would take too long to check all the time, but in this case, it's bad because we need it to check.) To make it check for new addons, the script deletes the extension cache and has Visual Studio rebuild it. (实际上,这是一件好事,因为要花费所有时间检查所有时间,但是在这种情况下,这很不好,因为我们需要对其进行检查。)要使其检查新插件,脚本将删除扩展缓存并包含Visual Studio重建它。 Rebuilding the cache takes most of the time that the script runs for. 重建缓存将花费脚本运行的大部分时间。 (Several minutes.) (几分钟。)

Once it's rebuilt, everything is ready to go, and the script deletes the temporary files that it created. 重建后,一切准备就绪,脚本将删除其创建的临时文件。

暂无
暂无

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

相关问题 将项目从VS2010迁移到VS2012后无法继承接口 - can't inherit interface after migrating project from VS2010 to VS2012 如何在VS2010和VS2012中加载数据库项目? - How to load database project in VS2010 and VS2012? DeploymentItem在VS2010和VS2012中的行为方式不同 - DeploymentItem behaving differently in VS2010 and VS2012 我可以在VS2010的VS2012中使用静态分析吗? - Can i use static analysis in VS2012 from VS2010? 从VS2010升级到VS2013(或VS2012)后,无法打开Visual Studio C#解决方案,错误消息“不支持给定路径的格式” - Can not open Visual Studio C# solution after upgrading from VS2010 to VS2013 (or VS2012), error message “The given path's format is not supported” AppFabric DataCacheFactory()初始化在VS2013中挂起,在VS2010和VS2012中正常工作 - AppFabric DataCacheFactory() initialization hangs in VS2013, works fine in VS2010 and VS2012 VS2012 OutOfMemoryException与VS2010没有异常的工作 - VS2012 OutOfMemoryException vs. VS2010 working w/o Exception 如何通过c#编程打开带有某些项目的Visual Studio exe(VS2008,VS2010,VS2012,VS2013)? - How to open Visual Studio exe's(VS2008,VS2010,VS2012,VS2013) with some projects by programming in c#? 当我在.csproj文件中使用通配符时,为什么Intellisense在VS2010中不起作用? - Why doesn't Intellisense work in VS2010 when I use wildcards in my .csproj file? Moq和Interop类型:在VS2012中工作,在VS2010中失败? - Moq & Interop Types: works in VS2012, fails in VS2010?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM