Configuring your V1.1 apps to run against V1.0


A friend of mine was trying to get his V1.1 app to run against V1.0 without much luck.  His config file had a startup section that looked like this:


<startup>


          <supportedRuntime version=”v1.1.4322”/>


          <supportedRuntime version=”v1.0.3705”/>


</startup>


This will NOT work on V1.0!


In V1.0, the V1.0 shim has no support for <supportedRuntime> tags so actually does not know what they mean.   


Now, here is where it gets unintuitive:


In V1.1, they started worrying about backwards/forwards compatibility and decided that perhaps the <requiredRuntime> tag was not the best thing to use and introduced the <supportedRuntime> tag. 


The V1.1 shim actually checks for the <supportedRuntime> tag first, and if it finds it ignores the <requiredRuntime>.


 So, in V1.1 even if you have something like:


 <?xml version=”1.0”>


<configuration>


            <startup>


                      <requiredRuntime version=”v1.0.3705”/>    


                        <supportedRuntime version=”v1.1.4322”/>


                        <supportedRuntime version=”v1.0.3705”/>


            </startup>


</configuration>


The V1.1 app will still run on V1.1 because the V1.1 shim reads the <supportedRuntime> tags first.


 


 


The V1.1 app WILL NOT run on V1.1 though, if you don’t include the <supportedRuntime> tags and only have the <requiredRuntime> tag.


<?xml version=”1.0”>


<configuration>


            <startup>


                      <requiredRuntime version=”v1.0.3705”/>    


            </startup>


</configuration>


 


In this case, the V1.1 shim sees the <requiredRuntime> tag since there are no <supportedRuntime> tags.

Comments (4)

  1. Jerry Pisk says:

    So how exactly does one write code that will run under any .Net framework isntalled? Or will we all have to re-release our apps once V2 comes out?

  2. RobVi says:

    The only concern you should have with running under any .NET framework installed is that the version installed is equal to or higher than the version your application was built against.

    There is a high bar for backwards compatibility, but forward compatibility (running V2.0 apps against either V1.1 or V1.0) is not officially supported. .Config files come into play when you are aware of specific breaking changes that may be affecting your application in a particular version of the .NET framework and want to "lock down" your app to a particular version(s).

    If no .config file is present, your V1.0 app should run okay on V1.1 and V2.0 and your V1.1 app should run okay against V2.0. The apps automatically float up the whatever higher runtime version is present in the absence of a .config file to lock them to a particular version and the absence of the version of the .NET framework they were built upon.

  3. Movie Guy says:

    so how was Las Vegas?