简体   繁体   English

将Visual Studio 2010项目转换为Visual Studio 2012

[英]Visual Studio 2010 project conversion to Visual Studio 2012

I have a bunch of solutions in my company that I need to convert and make compatible with VS2012 (keeping framework 4.0, btw). 我公司中有一堆解决方案,我需要转换它们并使其与VS2012兼容(保持框架4.0,btw)。 I tried opening them with 2012 directly, an the converter made a couple of changes in the .csproj files. 我尝试直接在2012年打开它们,转换器在.csproj文件中进行了一些更改。

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />

and below: 及以下:

<PropertyGroup>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>


<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />

Could anybody tell me what exactly these changes mean? 谁能告诉我这些变化究竟意味着什么? I tried googleing it with no luck. 我试过用谷歌搜索没有运气。

Plus, do I have any risk if I tried to rollback the .csproj to the previous version and leave it as it is? 另外,如果我尝试将.csproj回滚到以前的版本并保持原样,是否会有任何风险?

Thanks and regards! 谢谢并恭祝安康!

Each Visual Studio project is basically a big build script (you can actually use msbuild to build your project files from the command-line). 每个Visual Studio项目基本上都是一个很大的构建脚本(您实际上可以使用msbuild从命令行构建项目文件)。 What the converter is doing is pulling in the correct build properties for the new version of Visual Studio you're using. 转换器所做的就是为您使用的新版本的Visual Studio提取正确的构建属性。 You could actually go look at the files it's pulling in as they are located on your local computer. 实际上,您可以查看它们正在提取的文件,因为它们位于本地计算机上。

The first change you posted is pulling the correct version of Microsoft.Common.props (common build properties) needed by Visual Studio 2012. This import is in your old project, too, just a different version. 您发布的第一个更改是获取Visual Studio 2012所需的正确版本的Microsoft.Common.props (公共生成属性)。此导入也位于您的旧项目中,只是一个不同的版本。

The second change is importing all the necessary build "targets" (msbuild calls executable blocks of script "Targets") to build web applications. 第二个更改是导入所有必需的构建“目标”(msbuild调用脚本“目标”的可执行块)以构建Web应用程序。

If you're paranoid, sure, keep a backup of the old project but to be honest I don't see anything alarming in the above changes - they are just there to pull in the correct supporting files for the build engine. 如果您偏执狂,请确保保留旧项目的备份,但老实说,我看不到上述更改有什么令人震惊的地方-它们只是在为构建引擎提供正确的支持文件。

I hope that helps! 希望对您有所帮助! I worked with project files and msbuild for years and can give you a more detailed explanation if you need it. 我使用项目文件和msbuild已有多年,如果需要,可以给您更详细的解释。

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

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