Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

Reference conflict: 3.0.0 instead of 2.6.3 #674

Closed
Gitii opened this issue Dec 26, 2015 · 1 comment
Closed

Reference conflict: 3.0.0 instead of 2.6.3 #674

Gitii opened this issue Dec 26, 2015 · 1 comment

Comments

@Gitii
Copy link

Gitii commented Dec 26, 2015

Hi,
My project had some strange issues with mixed sharpdx versions (disclaimer: I never installed and referenced any 3.0.0 lib):
Although the projects files and nuget (both in Visual Studio and in the project files itself) referenced 2.6.3, the project compiled with 3.0.0. In addition the compiled assemblies were corrupt. Visual Studio just outputs a warning in the build window. Even using msbuild with verbose:diag did not help: Everything is fine, until "suddenly" the 3.6.3 is replaced by 3.0.0 "because it is referenced by" the 2.6.3 libs (yes, that is weird) (sorry, in german):

  Vereinheitlichte Abh„ngigkeit "SharpDX, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1". (Aufgaben-ID: 162)
...
      Dieser Verweis konnte nicht aufgel”st werden. Die SharpDX, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1-Assembly wurde nicht gefunden. Stellen Sie sicher, dass die Assembly auf dem Datentr„ger vorhanden ist. Falls dieser Verweis im Code erforderlich ist, k”nnen Kompilierungsfehler auftreten. (Aufgaben-ID: 162)
...
      Erforderlich für "SharpDX.Direct3D11.Effects, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1, processorArchitecture=MSIL". (Aufgaben-ID: 162)

BUT I found the solution, I just want to share it, in case someone has the same problems:
Visual Studio adds an assembly binding if you change the runtime version:
App.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
    </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="SharpDX" publicKeyToken="b4dcf0f35e5521f1" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="SharpDX.D3DCompiler" publicKeyToken="b4dcf0f35e5521f1" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
    </startup>
</configuration>

Just remove the <assemblyBinding> blocks and everything is fine again.
A similar issue can be found here

P.S.: This issue can be closed xD

@xoofx
Copy link
Member

xoofx commented Dec 27, 2015

Unless you started to reference 3.0.0 assemblies, and then reverted back to use 2.6.3 assemblies, I can't see why you would get 3.0.0 messing up the App.config file.

@xoofx xoofx closed this as completed Dec 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants