Unable to install or run the application - System.

2019-07-15 03:49发布

问题:

I am absolutely stuck.Searched and searched. I have a reference to System.Windows.Interactivity Version 4.5.0.0 When I release the system via ClickOnce the system does not installed and reports the following error.

Unable to install or run the application. The application requires that assembly System.Windows.Interactivity Version 4.0.0.0 be installed in the global assembly cache (GAC) first.

I am using DevExpress tools along with MVVMLight. If I try and add version 4.0.0.0 I get errors as 4.5 is required. Any help would be gratefully accepted. Thanks Scott

回答1:

When you publish your application - probably you have this in your output: No way to resolve conflict between "System.Windows.Interactivity, Version=4.5.0.0, ....".

What you need to do is add remapping in app.config like it's done here What should I change when the compiler tells me to "Consider app.config remapping" when I have no app.config file?



回答2:

Consider remapping it in app.config like this:

   <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35"
                          culture="neutral"/>
        <bindingRedirect oldVersion="4.0.0.0" newVersion="4.5.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>


回答3:

I had the same error but a other Problem and i was able to solve it by Checking following List

  • Project -> Properties -> Application -> Target Framework
  • Check the Target Framework of your System.Windows.Interactivity
  • Check the Target Framework of your Microsoft.Expression.Interactions


回答4:

In the Package Manager Console, run: Install-Package Expression.Blend.Sdk

Here is the package Expression.Blend.Sdk and contains both 4.0 and 4.5 versions of System.Windows.Interactivity