I have some .NET projects in a solution. When I publish them, I'd like to publish just the DLL of my src projects, not the test ones.
Both https://github.com/dotnet/docs/issues/13365 and https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-publish#msbuild mention IsPublishable can be used to do so.
IsPublishable seems to be ignored for .NET 5 project.
I set at any test project the following
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(ApplicationTargetFramework)</TargetFramework>
<IsPublishable>false</IsPublishable>
<IsPackable>false</IsPackable>
</PropertyGroup>
</Project>
but later, when I do a dotnet publish -c Release -o publish
I can still see the test project *.dll
and deps.json
. Why? How to achieve what I want?