Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Building and installing setup packages that require .NET Framework 1.1 on Windows Vista

Building and installing setup packages that require .NET Framework 1.1 on Windows Vista

  • Comments 5

I have run into this issue a couple of times recently while trying to install some of the currently available Windows Media Center applications and test them out on Windows Vista.  Many of the applications that are currently available were created with Update Rollup 2 for Windows XP Media Center 2005 as a target platform.  That means they were often built with Visual Studio .NET 2003 and the .NET Framework 1.1 and the setup was created using the VS 2003 setup/deployment project.

The settings for the setup/deployment projects in VS 2003 include an option to add a .NET Framework launch condition.  You can add this launch condition by doing the following:

  1. Open/create a VS 2003 setup/deployment project
  2. Right-click on the project in the Solution Explorer and choose View, then Launch Conditions
  3. Right-click on the Requirements on Target Machine item and choose Add .NET Framework launch condition

When you do this, your setup package will check for the existence of the .NET Framework 1.1 and block installation if it is not present.  This will likely cause confusion when users try to install this package on Windows Vista because Windows Vista already includes the .NET Framework 2.0 as part of the OS, and many users do not understand why they need to install an older version of the .NET Framework when a newer version is already present.

If you would like to avoid this confusion, you can do the following in your VS 2003 setup/deployment project to allow it to install if the .NET Framework 2.0 is present on the system (even if the .NET Framework 1.1 is not):

  1. Open your VS 2003 setup/deployment project
  2. Right-click on the project in the Solution Explorer and choose View, then Launch Conditions
  3. Locate your .NET Framework launch condition, right-click on it and choose Properties Window
  4. In the Properties Window, set the SupportedRuntimes value to 1.1.4322;2.0.50727

Note - you cannot use wildcards in the SupportedRuntimes value.  It must be set as listed in step 4 above to work as expected.

It is also very important to note that if you decide to include the .NET Framework 2.0 in the list of SupportedRuntimes for your application that this implies some additional testing work on your part.  You need to make sure that you test your application in scenarios where it is installed on a computer that has the .NET Framework 2.0 but not the .NET Framework 1.1.  In general, this scenario should work fine, however there is a small set of functionality that will not work because a few breaking changes were made to the .NET Framework 2.0 APIs for things like security reasons.

There are some good documents on the GotDotNet site with details about .NET Framework 2.0 breaking changes that will affect backwards compatibility:

If you have code that is affected by any .NET Framework 2.0 breaking changes, you will need to enforce the .NET Framework 1.1 in your application setup and also include some config files or other means of binding your application so it will only use the .NET Framework 1.1 at runtime.

If you do not have code affected by any .NET Framework 2.0 breaking changes, and your application setup currently checks for only the .NET Framework 1.1, I highly encourage you to try adding the 2.0.50727 SupportedRuntimes value and performing some application compatibility testing on systems that only have the .NET Framework 2.0.  This has the potential to offer customers a much smoother, less confusing installation scenario on Windows Vista.

 

  • Anthony Park has been working on a Windows Vista version of his MCEBrowser application.  As part...
  • on the topic of MCE and .net dependencies, I've developed an MCE app that uses an activex control written in c# using VStudio2005 (and using .net2.0).  Works fine on Vista, but does not work on MCE Update Rollup 2, even w the 2.0 framework installed.  

    I saw the config files for eshell and noticed that the supported runtime is 1.1 (NOT 2.0), and read the posts on this blog stating that .net2.0 causes problems w MCE.

    Couple questions:
    - can you confirm.  apps using .net2.0 will NOT run within MCE2005 update rollup2 because .net2.0 does breaks some of the functionality in MCE2005 update rollup2?  The post i read that stated this was kind of old - wanted to confirm that this is still the case

    - assuming the answer to my first question is yes, how can vstudio2005 be configured to make assemblies that use the 1.1 framework (instead of 2.0).  i'd like to develop a single control that works on vista and emerald.  
  • Hi DarrenY - I can confirm that it is fully supported to install the .NET Framework 2.0 on systems running Update Rollup 2 for MCE 2005.  The versions of the .NET Framework are designed to install and co-exist in a side-by-side manner.

    There was an issue with early beta builds of the .NET Framework 2.0 on older versions of Media Center 2005, but that has subsequently been fixed both in the .NET Framework 2.0 and in Update Rollup 2.

    You can use Visual Studio 2005 to create assemblies that will use the .NET Framework 1.1 at runtime, but you have to make sure to not use any of the new APIs introduced in the .NET Framework 2.0.  The most reliable way to make sure that you do not inadvertantly use any new 2.0 APIs in your assembly is to use Visual Studio .NET 2003 for your development.  This version of VS will only allow you to use APIs that are present in the .NET Framework 1.1.
  • Thanks for the reply.  

    RE .net2.0 and Update Rollup2: So explain this: I have a machine w Update Rollup 2 and vstudio2005 (clean installs - no betas).  The config files for eshell etc all say supportedRuntime is 1.1 (NOT 2.0).  If 2.0 is supported why doesnt the install of the 2.0 framework (which happened during the vstudio install) update the config file?  My app that uses a C# activex control was originally built w vstudio2005 (and uses 2.0 apis).  the control cannot be loaded on Update Rollup 2 w Vstudio2005 (loads fine on Vista).  Changing the eshell (and other MCE .exe) config files to have supportedRuntime be 2.0 fixes my problem - but my installer shouldnt have to do that . . .

    RE using vstudio2005 to create assemblies that will use 1.1.  what's the recommended method for doing this?  is it using .config files and supported/required runtime elements?  All the examples i've seen for doing this are for applications (exes).  in my case i have an assembly (dll) which is my activex control.  can i just put this info in myactivexcontrol.dll.config?  also is .net1.1 also installed on vista or is it just 2.0.  i am considering just building my control using vstudio2003, but now i'll prob have to use the same config file technique to say that the assembly can run on 1.1 and 2.0 (if 1.1 does not automatically come w vista)

    thanks for your help
  • Hi DarrenY - The config files that ship with Update Rollup 2 specifically bind Media Center to run on top of the .NET 1.1 runtime.  The default behavior with no config files would be for Media Center to "float" and run on the latest runtime version installed on the system.  We wanted to constrain our test matrix by locking ourself to a specific version.  However, doing this does *not* imply a lack of support for installing the .NET Framework 2.0 on an Update Rollup 2 system.  It simply means that even if you install .NET 2.0, Media Center will continue to run on top of .NET 1.1.

    If your ActiveX control is using .NET 2.0 APIs, it will not work on Update Rollup 2 because Update Rollup 2 will host it for you, and since it is bound to .NET 1.1, you won't have access to the newer APIs.  As you have seen, it is possible to update the Media Center config files to include the .NET Framework 2.0, but when you do that you are venturing into territory that the Media Center team has not tested so the results you get may be unpredictable.

    The most reliable way to build your control so that it will work both in Update Rollup 2 and Windows Vista Media Center is to use VS .NET 2003 to ensure that you do not use any 2.0-only APIs.  Since your control is hosted by other processes, creating a config file for your control won't have any effect.  It is the calling process that needs to have a config file in order for the .NET Framework to find it and use it.

    The .NET Framework 1.1 is not installed on Windows Vista by default.  However, you should not need to install it or use a config file.  You can let your control be hosted by Media Center, which will run using .NET 2.0 on Windows Vista, and as long as you do not use any APIs from 1.1 that are deprecated in 2.0, it should run fine.  Also, it will run fine in Update Rollup 2 because that version of Media Center is bound directly to the .NET 1.1.

    I'm sorry this scenario is confusing, but hopefully this helps.  Please let me know if you have any additional questions.
Page 1 of 1 (5 items)
Leave a Comment
  • Please add 3 and 1 and type the answer here:
  • Post