Mainfram Reality


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:

  1. Copy this MSBuild targets file to “C:\program files\msbuild\CrossCompile.CSharp.targets”
  2. Create a new C# project somewhere called MyApp
  3. Use notepad to edit MyApp.csproj. Replace the entire <Import> tag with
    <Import Project=”$(MSBuildExtensionsPath)\CrossCompile.CSharp.targets” />
  4. When prompted, reload the project. You’ll have to answer a security dialog.
  5. In Visual Studio, click the drop-down that says ‘Any CPU’ and select ‘Configuration Manager’
  6. Under Active Solution Platform, select <New…>
  7. Select ‘.NET 1.1’ and press OK
  8. Build and notice error about System.Collections.Generic. This means its working because generics aren’t supported in 1.1.
  9. Open Program.cs and delete the line: using System.Collections.Generic; And Rebuild.
No comments