Frage

I have a bunch of solutions in my company that I need to convert and make compatible with VS2012 (keeping framework 4.0, btw). I tried opening them with 2012 directly, an the converter made a couple of changes in the .csproj files.

<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?

Thanks and regards!

War es hilfreich?

Lösung

Each Visual Studio project is basically a big build script (you can actually use msbuild to build your project files from the command-line). What the converter is doing is pulling in the correct build properties for the new version of Visual Studio you're using. 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.

The second change is importing all the necessary build "targets" (msbuild calls executable blocks of script "Targets") to build web applications.

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top