How to deploy a ClickOnce .NET 3.5 application on a .NET 3.0 machine?
I have .NET 3.5 SP1 WPF application which I'm successfully deploying to client computers using ClickOnce.
Now I got a 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.5 .NET Framework 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.5 .NET Framework 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 开发者_Go百科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.5 .NET Framework error is still present. What should I do to fore ClickOnce to stop checking any prerequisites at all?
The project is created using Visual Studio 2010.
I may just find a cause of the issue - the ClickOnce publish process (and MageUI also) generates an 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...
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.
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.
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)
精彩评论