Archive for November, 2007
Target .NET Framework 1.1 using Visual Studio 2005
I have recently encountered a need to update an application for a client written using Microsoft .NET Framework 1.1. One of my options was to upgrade the application to .NET Framework 2 but I decided to do a little research to see if it is possible to use Visual Studio 2005 to develop for .NET Framework 1.1.
I found an article written by Jomo Fisher titled Hack the Build: Use Whidbey Beta2 to target .NET Runtime 1..
Here is the procedure outlined in the post mentioned above:
- Copy this MSBuild targets file to “C:\program files\msbuild\CrossCompile.CSharp.targetsâ€
- Create a new C# project somewhere called MyApp
- Use notepad to edit MyApp.csproj. Replace the entire <Import> tag with
<Import Project=”$(MSBuildExtensionsPath)\CrossCompile.CSharp.targets” /> - When prompted, reload the project. You’ll have to answer a security dialog.
- In Visual Studio, click the drop-down that says ‘Any CPU’ and select ‘Configuration Manager’
- Under Active Solution Platform, select <New…>
- Select ‘.NET 1.1’ and press OK
- Build and notice error about System.Collections.Generic. This means its working because generics aren’t supported in 1.1.
- Open Program.cs and delete the line: using System.Collections.Generic; And Rebuild.
