Unable to install or run the application: Click Once
Asked Answered
A

4

31

I published my .net application using ClickOnce, and all my users get the following error message on trying to open the program:

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

The version I actually use in my application is NEWER than the one mentioned in the error message. I also don't have this problem on my machine which I use to develop the application. I wonder why it is looking for the older version of the dll. I can't find where it is referenced by my application.

Could you please help me on this?

Antiparallel answered 16/7, 2012 at 13:35 Comment(6)
Do you include the assembly with your application, or should it be installed from a Telerik installation application? ClickOnce applications cannot install dlls in the GAC. Instead, they must be put there by another installer application.Libra
In Properties, the Publish tab, under Application Files list, I have it present as Include(Auto). In fact, I don't even need that dll. I excluded it from the project, and yet I have the same problem. Don't you know why ClickOnce (or the installation package it creates) wants that obsolete dll?Antiparallel
No, it shouldn't look for it unless it is referenced some where in the project. Sorry, I'm a bit stumped at the moment.Libra
And yet somehow that .dll somehow is looked for...Antiparallel
The "obsolete" dll is probably required because it is referenced by one of your references.Weltanschauung
For anyone else looking at this, Avis comment above was the solution for me. Make sure all of your telerik dlls are the same version.Piassava
A
41

I found solution here:

http://ablogontech.wordpress.com/2009/01/02/unable-to-install-or-run-the-application-the-application-requires-that-the-assembly-be-installed-in-the-global-assembly-cache-gac-first/

Excerpt from wordpress link:

I recevied this error while compiling my first C# production application. I had to do the following in Visual Studio for the project:

  1. In Solution Explorer, expand the References node and click the assembly listed in the error. Ensure Copy Local in the Properties grid is set to ‘True’.
  2. In the properties of the project, Publish | Application Files Tab, ensure the Publish Status for the assembly listed in the error is set to ‘Include’
Antiparallel answered 19/7, 2012 at 14:48 Comment(0)
C
3

In my case, the problem caused this error message was of incorrect library publishing configurations.

When i set my library property CopyLocal = false, and then in project publish application files set Publish Status to Include, all works fine after project rebuilding and next publishing.

Thus we tell to ClickOnce compiler, not to publish this library with application by default, and by changing Publish State from Prerequisites to Include tells ClickOnce, not to search this library in GAC.

Chaplet answered 6/10, 2015 at 10:1 Comment(1)
this was my issue. Stupidly added the app.config file as an embeddedResource. Set this to 'none' and i dont get the issueKei
C
1

You should also check that there is no wrong assembly binding redirection in your app.config file. Look for a node looking like:

  <dependentAssembly>
    <assemblyIdentity name="Telerik.Windows.Data" publicKeyToken="--SomePublicToken--" culture="neutral"/>
    <bindingRedirect oldVersion="0.0.0.0-3.0.2.0" newVersion="3.0.2.0"/>
  </dependentAssembly>

and ensure the range old to new makes sense, or simple, that this node makes sense at all. My first try would be to simply delete it and check again. It can happen that some NuGet packages mess with the config file in old version and this node is not needed anymore in newer once (and it's not deleted automatically).

Chorus answered 9/1, 2017 at 15:7 Comment(0)
W
1

if two version of the same dll referred across the dependent projects then that would be one of the root cause of the error.

It happened to me and complaining about NLog.dll, What I found is that my app referred one version of Nlog.dll and my library projects referred another version of Nlog.dll and manifest listed one version as dependency(install) and another version as dependency(requisite i.e. need to be present in the system even copy to local set to true).

Whopper answered 16/10, 2018 at 22:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.