Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

MSB4057: GetCopyToPublishDirectoryItems missing for per-RID project #259

Open
alexrp opened this issue Feb 28, 2021 · 0 comments
Open

MSB4057: GetCopyToPublishDirectoryItems missing for per-RID project #259

alexrp opened this issue Feb 28, 2021 · 0 comments

Comments

@alexrp
Copy link

alexrp commented Feb 28, 2021

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:

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" />
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant