我们的ASP.NET Web Api项目有两个部署配置(.pubxml):
- 将Web部署直接到Azure网站。
- 将程序包部署到本地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部署,它可以正常工作。