Easily convert Visual Studio 2012 Projects to 2010

Posts 1–2 of 2 · Page 1 of 1
Easily convert Visual Studio 2012 Projects to 2010
Since I refuse to update to 2012 version and some project do come built on VS2012, I've made a small tutorial on how to "downgrade" the project version for those who didn't already know.

1.) First, open up the .sln Solution file in a text editor.

Looking at the first 2 lines, you'll see this:
Code:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Simply change this to:
Code:
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2010
2.) Next, open any .csproj files you have. Do a quick search for this:

Code:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
All you have to do is change this to:
Code:
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

That's it. Hopefully that'll save you some headache.
I also prefer 2010. I normally just create a new project and manually copy over each important code file. This would be a lot faster. Much thanks.

----


2.) Next, open any .csproj files you have. Do a quick search for this:

Code:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
All you have to do is change this to:
Code:
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
...
Probably common sense, but each language has it's own .proj extension --> .csproj is for c-sharp, .vbproj for visualbasic, etc.


Also, some C++ projects won't have a "TargetFrameworkVersion" (because they don't use .net framework).

 
demo .vcproj file

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">;
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{1D3D3CC7-CE0A-45AA-A187-885D6ADBA860}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>d3_scratch_cpp</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.pr ops" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug| Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Releas e|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug| Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform). user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$( Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Releas e|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform). user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$( Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug| Win32'">
<LinkIncremental>true</LinkIncremental>
<LibraryPath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Lib\x86;$(LibraryPath)</LibraryPath>
<IncludePath>C:\Program Files %28x86%29\Microsoft DirectX SDK %28June 2010%29\Include;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Releas e|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug| Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(P reprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Releas e|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(P reprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="d3_scratch_cpp.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug| Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Releas e|Win32'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>


edit: Sry, thought this was in the "programming tuts" section. Guess I didn't need to point out the difference for other languages. Anyway, Thanks OP.
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us