Open alexrp opened 3 years ago
I have a project looking like this:
<Project Sdk="MSBuild.Sdk.Extras"> <PropertyGroup> <ExtrasBuildEachRuntimeIdentifier>true</ExtrasBuildEachRuntimeIdentifier> <IsPackable>true</IsPackable> <NoWarn>$(NoWarn);NU5131</NoWarn> <RuntimeIdentifiers>@(SupportedRuntimes)</RuntimeIdentifiers> <TargetFrameworks>net6.0</TargetFrameworks> </PropertyGroup> <ItemGroup> <ReferenceAssemblyProjectReference Include="../ref/runtime.ref.csproj" /> </ItemGroup> </Project>
It builds/packs fine on its own.
I reference it from another project like this:
<ProjectReference Include="../runtime/src/runtime.src.csproj" SkipGetTargetFrameworkProperties="true" ReferenceOutputAssembly="false" />
However, running dotnet pack from this project results in:
dotnet pack
runtime.src.csproj : error MSB4057: The target "GetCopyToPublishDirectoryItems" does not exist in the project.
A workaround I'm using for now is adding this at the bottom of the first project:
<Target Name="GetCopyToPublishDirectoryItems" />
I have a project looking like this:
It builds/packs fine on its own.
I reference it from another project like this:
However, running
dotnet pack
from this project results in:A workaround I'm using for now is adding this at the bottom of the first project: