在.NET 7中,我需要:
dotnet publish --self-contained --configuration Release --runtime win7-x64 --output myapp如何防止结果中的.pdb文件?理想情况下,只使用CLI?
我是否可以采取任何其他步骤来减少结果大小?
发布于 2022-03-15 03:50:52
根据这个GitHub问题,有两种方法可以禁用符号。
您可以编辑.csproj文件以添加以下两个条目:
<DebugType>None</DebugType>
<DebugSymbols>False</DebugSymbols>也可以将以下内容作为dotnet publish命令的一部分传递:
/p:DebugType=None /p:DebugSymbols=false例如:
dotnet publish /p:DebugType=None /p:DebugSymbols=false --self-contained --configuration Release --runtime win7-x64 --output myapp发布于 2022-05-31 13:54:03
若要仅为发行版.pdb文件禁用,请将其添加到Project.csproj中
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<DebugSymbols>False</DebugSymbols>
<DebugType>None</DebugType>
</PropertyGroup>https://stackoverflow.com/questions/71476329
复制相似问题