Search code examples
.netversionbackwards-compatibility

Convert Visual Basic .Net 2.0 program to 1.1 automatically


Here's a pretty silly question, but we want to do this. Is there an easy way to take a 2.0 project or 2.0 source code and convert it back 1.1. Obviously we have the 2.0 source and for compatibility reasons we want to create a 1.1 version. Any thoughts.


Solution

  • Eek.

    The simplest thing to do would be to add a SupportedRuntime attribute to your XML config. Documentation here: http://msdn.microsoft.com/en-us/library/w4atty68.aspx. Be advised that this does NOT guarantee the code will work against the 1.1 framework; it only tells the .NET 1.1 CLR that it can TRY.

    A more comprehensive way, which will leave your program hopelessly broken until you fix everything, is to go into the properties of each project in your solution and change the target framework (under the Application tab) to .NET Framework 1.1. Try to build the program; it will likely fail. Resolve the errors that come up, and keep building until it compiles.

    Keep in mind that a LOT of low-level program features, such as generics, and framework components providing interop with unmanaged resources, were introduced in .NET 2.0. You may find it infeasible to target 1.1 from 2.0, much more so than, say, if you were trying to go back to 2.0 from 3.5.