Ohad's Blog

Lets talk about .net !

Mirror at:
blogs.microsoft.co.il

News

         Ohad Israeli's Facebook profile
      

C# Code Snippts

Favorite Blogs

Israeli .Net Bloggers

How to create Framework 1.1 assembly using VS2005

I was wondering for some time if its possible to create vs2003 (framework 1.1) assembly using vs2005 as i would love the option to still be able to produce fw 1.1 code mainly for supportability while using the vs2005 IDE which has such great improvements…. Class Diagram… Generate unit Tests etc…

Jomo Fisher published on his blog the 9 steps of enabling fw 1.1 build on vs 2005 … and ITS WORKING !

1. Copy the content of this blog post  (MSBuild targets file) to “C:\program files\msbuild\” and name it “CrossCompile.CSharp.targets
2. Create a new C# console project (I’m working currently on directions for winforms app)
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 :
    choose Load Project Normally
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’ 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.

Because winform apps in vs 2005 uses partial classes the easiest way to create a new win form app in 2005 that is compatible to 2003 is to create a winform app in 2003 then open it in 2005 (it will be converted to 2005) and follow the above step to build it using fw 1.1

Note: you wont be able to use the new vs2005 controls on vs2003 app as the framework 1.1 will not know how to deal with them so when ever you’ll try compiling forms with such controls you’ll get a compile time error.

 

Comments

Robert McLaws said:

Have you seen my MSBuild Toolkit yet? It takes Jomo's targets and adds support for .NET 1.1, 1.0, VB, and C#. It also has an add-in for managing your projects targets in the IDE. You should check it out.

http://weblogs.asp.net/rmclaws/archive/2005/06/04/410360.aspx
# June 8, 2005 2:40 PM

尖锐湿疣 said:

Good!
# June 26, 2005 1:33 PM

forced sex said:

Wellcome to the real world.
# June 6, 2006 8:20 PM

skruti said:

this is a great Help.  Thanks a lot.

# August 1, 2007 10:46 AM

Mark Deraeve said:

I keep getting this error:

Error 6 "resgen.exe" exited with code -1163019603. TubeSetup

Any ideas?

Thanks!

# December 21, 2007 2:10 AM

lap said:

I've got this error too:

error MSB6006: "resgen.exe" exited with code -1163019603.

# April 14, 2008 8:55 AM

CDM said:

I got pointed here form an MSDN question I had, trying to do this...

>(I’m working currently on directions for winforms app)

I don't suppose this got done?

I tried the above, using a C# form (not console), and it looked promising up to step 8.  I get lots of build errors, having nothing to do with System.collections.Generic.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3247: Found conflicts between different versions of the same dependent assembly.

I notice the csc compiler command now mostly uses V1.1, but in the Output window, the following still shows up:

... /reference:C:\WINDOWS\assembly\GAC_MSIL\System.Deployment\2.0.0.0__b03f5f7f11d50a3a\System.Deployment.dll ...

I can't find a System.Deployment in the V1.1 directories; so it apparently needs something different for this to work.

# April 22, 2008 2:12 PM

Andreas said:

Thank you very much. Helped me out of an unpleasant situation.

# August 26, 2008 5:33 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)