-
Notifications
You must be signed in to change notification settings - Fork 90
Description
Hi, when I try to compile this minimalistic project
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.0.461" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.Build.Runtime" Version="16.0.461" ExcludeAssets="runtime;contentfiles" />
<PackageReference Include="Microsoft.Build.Locator" Version="1.2.6" />
</ItemGroup>
</Project>
the following build error occurs:
A PackageReference to Microsoft.Build.* without ExcludeAssets="runtime" exists in your project. This will cause MSBuild assemblies to be copied to your output directory, causing your application to load them at runtime. To use the copy of MSBuild registered by MSBuildLocator, set ExcludeAssets="runtime" on the MSBuild PackageReferences. To disable this check, set the property DisableMSBuildAssemblyCopyCheck=true in your project file (not recommended as you must distributed all of MSBuild + associated toolset). Package(s) referenced: Microsoft.Build.Runtime"
It's caused by the fact that instead of specifying ExcludeAssets="runtime" I specified ExcludeAssets="runtime;contentfiles" to get rid of all the included assets as well since AFAIK they should all be present in the located MSBuild installation. The application seems to work this way well, so I just want to ask if there's any catch I'm missing or I can just ignore the error using DisableMSBuildAssemblyCopyCheck. Thanks.