Wednesday, October 6, 2010

ClickOnce 3.5 and .NET 4.0 problems

Last week we discovered some strange behavior in the ClickOnce implementation for Visual Studio 2010.

We created a clickonce setup from the Visual Studio 2010 command line by using

msbuild /target:publish

This created a setup file, an application manifest and all the required files as you should expect.  Important to notice is that it’s a Visual Studio 2010 solution but we are compiling against the .NET 3.5 framework(Target=.NET 3.5).

If we try to install this ClickOnce application on a system that does not have .NET 4.0 installed everything works.

However when we try to install the application on a .NET 4.0 system, the installation blows up with following error:

* Activation of \\dev\test.application resulted in exception. Following failure messages were detected:

                        + Deployment manifest is not semantically valid.

                        + Deployment manifest is missing <compatibleFrameworks>.

This error is telling us that the manifest file is not correct as the <compatibleFrameworks> section is missing in the XML file. This section is a required section for a .NET 4.0 manifest but NOT for a .NET 3.5 manifest. As this application is a .NET 3.5 application, he shouldn’t complain.

It seems like a .NET 4.0 system incorrectly assumes that it has to install the application by using the .NET 4.0 clickonce system.

Strange thing is that if we create the build by using the Publish properties inside the Visual Studio 2010 IDE, everything works. This is especially annoying because we use the same functionality on our build server to automatically create our application packages.

No comments: