views:

257

answers:

3

I have .Net 3.5 SP1 WPF application which I'm successfully deploying to client computers using ClickOnce. Now I got new requirement - one of our clients need to run the application on machines equipped just with .Net 3.0 and it's entirely impossible to upgrade or install anything on the machines. I already tried to run the 3.5 application with some of the 3.5FW DLLs copied to the application directory and it worked without any problems. The only problem at the moment is ClickOnce. I already made it to include the 3.5FW System.*.dll files in list of application files, but it always aborts installation on 3.0 machine with this error message:

Unable to install or run the application. The application requires that assembly System.Core Version 3.5.0.0 be installed in the Global Assembly Cache (GAC) first. Please contact your system administrator.

I already tried to tweak prerequisites on Publish tab of my project, but no combination solved the issue.

What part of ClickOnce is responsible for checking prerequisites? I already tried to deploy using mageui.exe, but the 3.5FW error is still present. What should I do to fore ClickOnce to stop checking any prerequisites at all?

The project is created using VS2010.


I may just find a cause of the issue - the ClickOnce publish process (and MageUI also) generates application manifest file which defines dependency "preRequisite" on some 3.5 assemblies (System.Core, System.Data.Entity). So I just need to force ClickOnce publish/MageUI not to generate these dependencies somehow...

A: 

How about using a stub .exe that targets the 3.0 Framework? You could deploy your application and the stub in the same ClickOnce install, with the stub as the entry point. The stub's only job would be to launch the 3.5 executable.

I'm not sure if you'll be able to create this type of deployment with Visual Studio. You may need to use MageUI instead.

Edit
In response to your comment, try removing the "Prerequisite" entries from the manifest file. Just remove them using a text editor and then resign with the command line Mage.

whatknott
I may just find a cause of the issue - the ClickOnce publish process (and MageUI also) generates application manifest file which defines dependency "preRequisite" on some 3.5 assemblies (System.Core, System.Data.Entity). So I just need to force ClickOnce publish/MageUI not to generate these dependencies somehow...
Buthrakaur
A: 

You can't run an application that targets .NET 3.5 on a machine without .NET 3.5. If you want to install this application on a machine that only supports .NET 3.0, you will have to downgrade the target framework to .NET 3.0, and change your prerequisite accordingly.

In a C# solution, this is on the Application tab for each project's property pages.

In a VB solution, IIRC it is under the Compile tab, Advanced options.

RobinDotNet
I surely can run the 3.5 app on machine with 3.0 FW if I supply 3.5 assemblies like System.Core.dll, System.ServiceModel.Web.dll, System.ComponentModel.DataAnnotations.dll etc. along with my app assemblies.
Buthrakaur
Can you legally include individual .Net dll to redistribute. How can you make sure that all dependent dlls are included. Also it is very non-standard and there will be no way for example to apply a security patch from Microsoft by the sysadmin.
Pratik
You're right of course - this is just evil. Unfortunately our customer (big corporation) has some paranoid IT regulations which keeps their SW versions quite deep in history (they have to use IE6 for example) and restricts any updates.
Buthrakaur
You're asking for trouble if you start including .NET 3.5 assemblies with the application. It's much, much safer just to downgrade the application to .NET 3.0.
RobinDotNet
A: 

I got this message because I checked the option to create a desktop shortcut - had to add a prerequisite for .NET Framework 3.5 SP1 to fix it, so you might have to add the shortcuts in the program (if this is causing the message and you can't upgrade the framework)

Rox