Sign in to follow this  
Stefan Fischlschweiger

Problem with assembly references

Recommended Posts

Recently I'm getting the same error all over my solution:

 

The type X is defined in a non-referenced assembly. Add a reference to the assembly '<name>, <version>, <culture>, <publickeytoken>

 

Thing is, these assemblies are allready referenced and all 4 of these values including publickeytoken are 100% correct.

 

e.g.: I get the error: The type 'SharpDX.ComObject' is defined in a non-referenced assembly. Add a reference to the assembly 'SharpDX, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b4dcf0f35e5521f1'

 

When I check the file everything is as the error message tells me it should be, but the errors keep coming.

 

Restarting Visual Studio does not solve the problem. Sometimes removing and re-adding the references does, but only partially

Edited by Lordadmiral Drake

Share this post


Link to post
Share on other sites

I've found the issue, when changing the references from DX11 to DX11_2 I appearantly managed to mix up signed and unsigned dlls.

 

But now a new problem came up:

While all references throughout the solution are now set to DX11.2 net40 unsigned, one single reference keeps setting itself back to the signed version. No matter how ofter I delete and re-add the reference, I keeps the signed version.

 

I also tried manually editing the path in the csproj file, but without success. While that file contains the correct path now the wrong one is still displayed when clicking on the reference in the solution explorer and checking in the properties window

 

EDIT: If I manually copy the correct dll to the output folder and run the exe directly from there it works just fine. It's just that one stubborn reference path that keeps pointing to DirectX11_2_Signed-net40\SharpDX.Direct2D1.dll instead of DirectX11_2-net40\SharpDX-Direct2D1.dll causing the wrong dll to be copied, breaking the program

Edited by Lordadmiral Drake

Share this post


Link to post
Share on other sites

Addendum:

 

Even if I remove the reference from the project and then build it I still get the wrong dll copied over to the Debug folder. If I unload and reload the project or the entire solution the reference is suddenly there again. If I add the correct reference from the correct folder then the correct reference path is stored in the csproj file.

What's strange too is the wrong path by itself:

Correct: ...\MetastormDX\packages\SharpDX.2.6.3\Bin\DirectX11_2-net40\SharpDX.Direct2D1.dll

Wrong: ...\MetastormDX\packages\SharpDX.2.6.3\build\..\Bin\DirectX11-signed-net40\SharpDX.Direct2D1.dll

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this