简体   繁体   中英

Managing local nuget depedencies in single .sln

I created a solution containing 2 DLLs that are published as nugets. I took Hangfire as an exemple.

So, if I have a DLL named hangfire and a second one hangfire.sql, this mean hangfire.sql depends on hangfire. hangfire.sql is refering hangfire as a nuget and not a project dll. Then, even if I specify the dependency in the .sln, I get an error when I build the solution saying the first nuget couldn't get restored.

Is it doable? The alternative I see is hangfire.sql to use the version already published of hangfire and not the version present in the .sln

I'm on Visual Studio 2019

Thanks

We solved this by adding dotnet restore in the .csproj as follow:

<Target Name="NuGet restore" BeforeTargets="BeforeBuild">
    <Exec Command="dotnet restore" />
</Target>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM