- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我明白了
'The "TransformWebConfig" task failed unexpectedly. System.Exception: The acceptable value for AspNetCoreModuleHostingModel property is either "InProcess" or "OutOfProcess".'
在 win-x64 环境下发布 ASP.NET Core 2.2.0 应用程序(实际上是包含的示例应用程序)时出错。 Visual Studio 2017 和 2019 都给出相同的错误。我正在使用 Windows 10。我应该怎么做才能解决这个问题?发布输出的最后一部分是:
c:\users\engin\source\repos\NetCoreWebApplication2\NetCoreWebApplication2\obj\Release\netcoreapp2.2\win-x64\PubTmp\Out\
C:\Program Files\dotnet\sdk\2.2.200-preview-009648\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(49,5): Hata MSB4018: "TransformWebConfig" görevi beklenmedik biçimde başarısız oldu.
System.Exception: The acceptable value for AspNetCoreModuleHostingModel
property is either "InProcess" or "OutOfProcess".
konum: Microsoft.NET.Sdk.Publish.Tasks.WebConfigTransform.TransformAspNetCore(XElement aspNetCoreElement, String appName, Boolean configureForAzure, Boolean useAppHost, String extension, String aspNetCoreModuleName, String aspNetCoreHostingModel)
konum: Microsoft.NET.Sdk.Publish.Tasks.WebConfigTransform.Transform(XDocument webConfig, String appName, Boolean configureForAzure, Boolean useAppHost, String extension, String aspNetCoreModuleName, String aspNetCoreHostingModel, String environmentName)
konum: Microsoft.NET.Sdk.Publish.Tasks.TransformWebConfig.Execute()
konum: Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
konum: Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
2 Derleme başarısız oldu. Daha fazla ayrıntı için çıktı penceresini denetleyin.
========== Oluşturma: 1 başarılı, 0 başarısız, 0 güncel, 0 atlandı ==========
========== Yayın: 0 başarılı, 1 başarısız, 0 atlandı ==========
最佳答案
我建议完全禁用 web.config 转换。在 ASP.Net Core 项目中,您可能不需要转换 web.configs,因为提供环境变量是按约定处理的 appsettings.[Environment].json
文件。
来自 https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-2.2 的文档:
To prevent the Web SDK from transforming the web.config file, use the
<IsTransformWebConfigDisabled>
property in the.csproj
file:
<PropertyGroup>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup>
关于asp.net-core - "TransformWebConfig"任务意外失败 - System.Exception : The acceptable value for AspNetCoreModuleHostingModel property is either,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53943601/
我明白了 'The "TransformWebConfig" task failed unexpectedly. System.Exception: The acceptable value for
我是一名优秀的程序员,十分优秀!