我像这样发布我的 ASP.Net Core 3.1 服务器:
dotnet publish --configuration Release --runtime win7-x64 -p:PublishTrimmed=true --output c:\MyServer
Run Code Online (Sandbox Code Playgroud)
我在 c:\MyServer 中得到的是很多国际语言目录:cs、de、es、fr、zh-hans 等
如何只发布英文版?
我尝试ExcludeFoldersFromDeployment在我的 csproj 中使用:
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
<AspNetCoreHostingModel>inprocess</AspNetCoreHostingModel>
<Nullable>enable</Nullable>
<ExcludeFoldersFromDeployment>cs;de;es;fr;he;hi;it;ja;ko;nl;pl;pt;ru;tr-TR;zh-Hans;zh-Hant</ExcludeFoldersFromDeployment>
</PropertyGroup>
Run Code Online (Sandbox Code Playgroud)
但这没有帮助
有什么帮助吗?