简体   繁体   中英

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 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.

我收到此消息是因为我选中了创建桌面快捷方式的选项 - 必须添加.NET Framework 3.5 SP1的先决条件才能修复它,因此您可能必须在程序中添加快捷方式(如果这导致了消息而您无法升级框架)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM