【发布时间】:2019-09-01 09:33:06
【问题描述】:
我正在创建一个我想要作为“dotnetcore 全局工具”和独立 exe 的 exe。这是我的 csproj 的样子:
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<LangVersion>7.1</LangVersion>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<PlatformTarget>AnyCPU</PlatformTarget>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<PackAsTool>true</PackAsTool>
<IsPackable>true</IsPackable>
<ToolCommandName>HostRunner</ToolCommandName>
<PackageOutputPath>./nupkg</PackageOutputPath>
<AssemblyName>HostRunner</AssemblyName>
</PropertyGroup>
我可以运行dotnet pack没问题,但是当我运行时
dotnet publish my.csproj -r=win10-x64 -c=Debug --self-contained
我收到一条错误消息error NETSDK1053: Pack as tool does not support self contained.
我做错了什么?!
【问题讨论】:
标签: c# command-line-interface .net-core-2.2