I have a .net solution consisting of 3 projects
When I create a NuGet on myproject.Core:
dotnet pack c:\Dev\myproject.Core.csproj -c Release
and try to install it in another project it's saying that
I'm missing.Models and.Interfaces.
Is there a way to include myproject.Models and myprojects.Interfaces within.Core NuGet? so that I have to install ONLY.Core nuGet in my projects?
if your dependency is a nuget package you can add a dependency tag in your nuspec file
<dependencies>
<group targetFramework=".NETCoreApp3.0" >
<dependency id="myproject.Interfaces" version="3.0.1" />
<dependency id="myproject.Models" version="3.0.1" />
</group>
<group targetFramework=".NETCoreApp3.1" >
<dependency id="myproject.Interfaces" version="3.0.1" />
<dependency id="myproject.Models" version="3.0.1" />
</group>
</dependencies>
but if your dependency is a dll you can add as a normal file
<files>
<file src="lib\netcoreapp3.0\myproject.Interfaces.dll" target="lib\netcoreapp3.0\myproject.Interfaces.dll" />
<file src="lib\netcoreapp3.0\myproject.Models.dll" target="lib\netcoreapp3.0\myproject.Models.dll" />
<file src="lib\netcoreapp3.1\myproject.Interfaces.dll" target="lib\netcoreapp3.1\myproject.Interfaces.dll" />
<file src="lib\netcoreapp3.1\myproject.Models.dll" target="lib\netcoreapp3.1\myproject.Models.dll" />
</files>
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.