2

I am trying to publish a nuget packed using dotnet pack along with all references dll´s. Hence I added a Content include node to include all the referenced dll's inside the pushed package.

<ItemGroup>
    <ProjectReference Include="..\MyDA\MyDA.csproj" />
    <ProjectReference Include="..\Interfaces\Interfaces.csproj" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="$(OutDir)\*.dll">
      <PackagePath>lib\$(TargetFramework)</PackagePath>
      <Pack>true</Pack>
    </Content>
  </ItemGroup>

The problem is when I import the nuget into a project it tries to get the references as packages from the feed which is what I trying to avoid by including the dll´s in the same package. Here is the error when importing the nuget.

Severity    Code    Description Project File    Line    Suppression State
Error   NU1101  Unable to find package MyDA. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org, MyFeed   MySolution  C:\MySolution\MyDA\MyDA.csproj  1

Is there a way to prevent importing the references as packages from the Feed?

doorman
  • 15,707
  • 22
  • 80
  • 145
  • Does this answer your question? [Build NuGet Package automatically including referenced dependencies](https://stackoverflow.com/questions/16173568/build-nuget-package-automatically-including-referenced-dependencies) – nilsK Oct 30 '20 at 10:39
  • 1
    Hi @nilsK thanks your link directed me to https://stackoverflow.com/questions/46376256/visual-studio-2017-nuget-pack-exclude-project-reference-as-another-nuget-referen which solved the problem – doorman Oct 30 '20 at 15:46
  • Great, have a nice weekend! – nilsK Oct 30 '20 at 16:27

0 Answers0