gpt4 book ai didi

asp.net - Azure 网站 - Web.config 转换失败 "No element in the source document matches/configuration/system.identityModel/identityConfiguration"

转载 作者:行者123 更新时间:2023-12-01 23:57:08 25 4
gpt4 key购买 nike

我们的 ASP.NET Web Api 项目有两个部署配置 (.pubxml):

  1. 直接将 Web 部署到 Azure 网站。
  2. 将程序包部署到本地 Zip 文件。

Web 部署 (1) 工作得很好。包部署到 zip 失败并出现以下错误:

Warning 3   No element in the source document matches '/configuration/system.identityModel'     20  10  MyWebProject
Error 4 No element in the source document matches '/configuration/system.identityModel/identityConfiguration' 21 10 MyWebProject

查看详细日志,我可以看到它在 Web.config 转换期间失败。

        ParameterizeTransformXml:   No element in the source document matches '/configuration/appSettings/add[@key='ida:AudienceUri']'
ParameterizeTransformXml: Not executing SetTokenizedAttributes (transform line 7, 9)
ParameterizeTransformXml: No element in the source document matches '/configuration/appSettings/add[@key='ida:Realm']'
ParameterizeTransformXml: Not executing SetTokenizedAttributes (transform line 10, 9)
ParameterizeTransformXml: No element in the source document matches '/configuration/appSettings/add[@key='ida:FederationMetadataLocation']'
ParameterizeTransformXml: Not executing SetTokenizedAttributes (transform line 13, 9)
Warning : No element in the source document matches '/configuration/system.identityModel'
ParameterizeTransformXml: Not executing RemoveAll (transform line 24, 14)
Error : No element in the source document matches '/configuration/system.identityModel/identityConfiguration'
ParameterizeTransformXml: Not executing Insert (transform line 27, 9)
ParameterizeTransformXml: No element in the source document matches '/configuration/system.identityModel'
ParameterizeTransformXml: Not executing SetTokenizedAttributes (transform line 33, 9)
ParameterizeTransformXml: No element in the source document matches '/configuration/system.identityModel.services'
ParameterizeTransformXml: Not executing SetTokenizedAttributes (transform line 42, 9)
ParameterizeTransformXml: No element in the source document matches '/configuration/system.identityModel.services'
ParameterizeTransformXml: Not executing SetTokenizedAttributes (transform line 45, 9)
ParameterizeTransformXml: Transformation failed
Done executing task "ParameterizeTransformXml" -- FAILED.
Done building target "_TransformWebConfigForAzureAuthenticationCore" in project "MyWebProject.csproj" -- FAILED.
Done building project "MyWebProject.csproj" -- FAILED.

我需要配置哪些额外的构建信息才能使 Zip 部署克服这些错误?如果我进行直接 Web 部署,它就可以正常工作。

最佳答案

检查您的发布设置,看看是否已将 EnableADPublish 设置为 true。这是我的问题(我通过其他方式配置 Azure AD Auth),所以我只是将其设置为 false,一切都运行良好。

<EnableADPublish>false</EnableADPublish>

干杯,杰夫

关于asp.net - Azure 网站 - Web.config 转换失败 "No element in the source document matches/configuration/system.identityModel/identityConfiguration",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28416166/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com