jan salawa
jan salawa

Reputation: 1208

Nuget referenced DLL not beeing copied to referencing project

I have two project A,B. Project B has a reference to project A (B -> A). Project A has Thinktecture.IdentityServer.Core package which has dependency on Thintecture.IdentityModel and a simple class which make use of Thinktecture.IdentityServer.Core:

public class Class1
{
    public UseThinktecturecoreInOrderToCopyDll()
    {
        // wrapper for Thinktecture.IdentityModel
        Thinktecture.IdentityModel.Web.ProtectionMode wrapper
            = Thinktecture.IdentityModel.Web.ProtectionMode.MachineKey;
    }
    Thinktecture.IdentityServer.Repositories.ICacheRepository repository;
}

Now when I build solution the Thintecture.IdentityModel is copied to project A, but is not copied to project B. But when I update packages then Thintecture.IdentityModel dll on next solution build is copied to project B. Can anyone explain this behavior? How can I force copying without updating packages? why packages update solve the problem?

I have this problem on more complex solution. I know it is possible to solve the problem by building project A separately but I'm not satisfied with that solution as it require to keep building the project A separately.

*Also I do not like a solution where I have to add reference to each project which I'm indirectly using (for Thinktecture.IdentityModel).

Upvotes: 1

Views: 572

Answers (1)

waldunio
waldunio

Reputation: 76

You have problem with references in your NuGet packages. Your Thinktecture.IdentityServer.Core has a reference on Thintecture.IdentityModel 3.4.0 and you have installed Thintecture.IdentityModel 3.0.0. So visual studio doesn't copy invalid Thintecture.IdentityModel 3.0.0 reference. When you update your Thintecture.IdentityModel to version 3.4.0 it starts working because reference is valid.

Upvotes: 1

Related Questions