This project has moved and is read-only. For the latest updates, please go here.

Conflict with Microsoft.Practices.ServiceLocation ?

Feb 9, 2013 at 7:55 PM
I've got an issue where my WPF application cannot be published with ClickOnce.

The application uses Nuget packages MVVM Light, Unity 2.1.505.2, CommonServiceLocator 1.0.

The problem is that when I publish, it all build fine, but I get this error when I try and install the clickonce package:

Unable to install or run the application. The application requires that assembly Microsoft.Practices.ServiceLocation Version be installed into the Global Assembly Cache (GAC) first.

I did some digging and saw that there were two references to that assembly in the manifest, and one of them was marked as a prerequisite which I can't get rid of:
    <dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
      <assemblyIdentity name="Microsoft.Practices.ServiceLocation" version="" publicKeyToken="59D6D24383174AC4" language="neutral" processorArchitecture="msil" />

    <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="Microsoft.Practices.ServiceLocation.dll" size="29760">
      <assemblyIdentity name="Microsoft.Practices.ServiceLocation" version="" publicKeyToken="31BF3856AD364E35" language="neutral" processorArchitecture="msil" />
          <dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
        <dsig:DigestMethod Algorithm="" />
I'm pretty sure the issue with the ClickOnce is down to there being two references to this assembly with the same version (but notice the different public key tokens).

I created a very simple repro as follows:
  1. Create a new WPF application
  2. Add Nuget package MVVM Light
  3. Add Nuget package Unity
  4. Build and publish the WPF application
  5. Try and install the published MyApp.application clickOnce package....get the error detailed above
Here's a repro project:

Skydrive repro project link

Any ideas how I might get over this?
Feb 14, 2013 at 8:26 PM

Please try again. I just pushed a new build ( to Nuget that is depending on the official CommonServiceLocator package where available. This should fix your issue. If you have more problems, please make sure to let me know.

Feb 16, 2013 at 9:38 AM
Mr Bugnion you are a legend, this has fixed all my woes. Kudos on the speedy turnaround....cheers!
Apr 21, 2015 at 8:49 PM

I am facing the similar issue when I am using MVVM Light libraries only version I saw the similar entries on the .Manifest file. Appreciate any help on this.