Jomo Fisher – A while back, I posted a sample that showed how to target the .NET 1.1 runtime (the version that came with Visual Studio .NET 2003 also known as Everett) with MSBuild. Now Beta 2 has rolled around and I can see that there have been enough changes to MSBuild to warrant an entire rewrite of that original sample.
I’ll get into the details of how it all works down below, but right now let’s just get it working on your machine. Here are the steps:
(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 VS, click the drop-down that says ‘Any CPU’ and select ‘Configuration Manager’ (6) Under Active Solution Platform, select <New…> (7) Select ‘.NET 1.1’ (pretty cool, eh?) 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.
(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 VS, click the drop-down that says ‘Any CPU’ and select ‘Configuration Manager’
(6) Under Active Solution Platform, select <New…>
(7) Select ‘.NET 1.1’ (pretty cool, eh?) 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.
That’s it, its working.
As with the last sample I posted on this, I expect that only basic scenarios will work here. If you run into a problem, drop me a note. If I see a quick solution I'll post it. Otherwise, I can still publish those limitations here so that other people can learn from your experience.
What’s New?
There are some differences between this version and the prior sample I published that show off some nice new features in MSBuild for Beta2:
Moving On
At the end of this month I'm moving from the MSBuild team (5th floor, building 41 in Redmond) to the C# team (1st floor, building 41 in Redmond). Working on MSBuild has been a blast and I intend to keep on blogging about it if I think I having something of value to say. After a while, I hope to have something useful to say about C# too. I think "Hack the Build" still fits, so I'll keep the name.
This posting is provided "AS IS" with no warranties, and confers no rights.
kameralı sesli audiovideo chat login - sohbet siteleri - odasohbeti
hi,
i am using vs 2010 , i have a project has been written at vs 2003 .net 1.1. I want to use MSbee project , there 4 layer, 3 of them class libraries and they build perfectly. One of them Web application and it does not build. İs there any workaround it ? Or is it possible to build web applications ? I want to use vs 2010 target framework 1.1.