© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
15 replies
Anton

MSBuild make it NOT copy a dependency to the output path

    <!-- Make sure the CLI has been built before calling into it -->
    <ItemGroup Condition="'$(IsTools)' != 'True'">
        <ProjectReference Include="$(RootDirectory)tools\Cli\Cli.csproj">
            <IncludeAssets>none</IncludeAssets>
            <ExcludeAssets>all</ExcludeAssets>
            <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
        </ProjectReference>
    </ItemGroup>
    <!-- Make sure the CLI has been built before calling into it -->
    <ItemGroup Condition="'$(IsTools)' != 'True'">
        <ProjectReference Include="$(RootDirectory)tools\Cli\Cli.csproj">
            <IncludeAssets>none</IncludeAssets>
            <ExcludeAssets>all</ExcludeAssets>
            <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
        </ProjectReference>
    </ItemGroup>

How in the world does this still end up copying everything but the dll? It copies the exe and runtimeconfig and deps jsons, whatever those are. I'm not going to be calling it at runtime.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

MSBuild ProjectReference not copying output to folder
C#CC# / help
2y ago
Copy PackageReferences to output directory
C#CC# / help
4mo ago
Forcing MSBuild to use non -windows version of a dependency
C#CC# / help
2mo ago
❔ MSBuild is it possible to set a additonal property?
C#CC# / help
3y ago