ClickOnce and GAC

久未见 提交于 2020-02-03 05:43:27

问题


I have WinForms application .net 3.5. I deploy it using clickonce in intranet with several client machines. I publish application in intranet web server (http://desbiz/CarwinClickOnce).

In developer environment (my PC), my application uses GAC assemblies, like Fk.Security.Common.dll v.1.0.0.0.

In tab Publish -> Application files in Properties of WinForms application csproj, I set value Include for Fk.Security.Common.dll reference.

Now,

some client machines have Fk.Security.Common.dll v.1.0.0.0 reference in GAC

others client have NOT Fk.Security.Common.dll v.1.0.0.0 reference in GAC

If the client installs the winform application using ClickOnce there are this issues:

1.) If Fk.Security.Common.dll v.1.0.0.0 reference is in GAC, the Fk.Security.Common.dll v.1.0.0.0 reference included in ClickOnce not apply.

Problem: perhaps compilde code in Fk.Security.Common.dll v.1.0.0.0 reference included in ClickOnce is more update than code in Fk.Security.Common.dll v.1.0.0.0 reference is in GAC

Solution: uninstall Fk.Security.Common.dll v.1.0.0.0 reference in GAC, and install in GAC the Fk.Security.Common.dll v.1.0.0.0 reference included in ClickOnce Publish...

(how can I uninstall/install assemblies in GAC using ClickoNce????)

2.) If Fk.Security.Common.dll reference NOT is in GAC, the Fk.Security.Common.dll v.1.0.0.0 reference included in ClickOnce apply. No problem.

note: the user in client machine has Administrator permissions.

Any solution about this issues ??

Thanks in advance.


回答1:


ClickOnce cannot install or uninstall files in the GAC.

Did you write the Fk.Security.Common.dll? If so, increase the version number (v.1.0.0.1) and recompile it. When you reference it, set the "Specific Version" property to "True" and the "Version" property to your new version number. This should fix your problem without having to uninstall the old assembly from everyone's GAC.




回答2:


In your Visual studio project click on the referenced assembly (Fk.Security.Common.dll) and in the properties window set the Copy Local property to True (I assume you are using ClickOnce)




回答3:


Unable to install or run the application. The application requires that assembly Telerik.Windows.Data Version 2012.1.215.40 be installed in the Global Assembly Cache (GAC) first

I had same error when I forgot change solution configuration from "Debug" to "Release" in the Visual Studio. Before publish.



来源:https://stackoverflow.com/questions/2265414/clickonce-and-gac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!