Failed to encrypt destination web.config when using MS build plugin in Jenkins

给你一囗甜甜゛ 提交于 2019-12-11 12:06:34

问题


I am trying to setup Jenkins to build and deploy my ASP.net MVC project.

My Command Line Arguments are

/p:Configuration=Staging  
/p:DeployOnBuild=true  
/p:PublishProfile=Staging  
/p:ExcludeApp_Data=False  
/p:AllowUntrustedCertificate=True  
/p:LastUsedPlatform="Any CPU"  
/p:MSDeployPublishMethod=WMSVC  
/p:DeployIisAppPath=User Information Portal;  
/p:MsDeployServiceUrl=x.x.x.x  
/p:MSDeployEnableWebConfigEncryptRule=False  
/p:username=x  
/p:password=xx

When Jenkins runs the project it always fails with an error

msdeploy error ERROR_FAILED_TO_ENCRYPT_WEB_CONFIG: Web deployment task failed. (Failed to encrypt destination web.config: C:\Jenkins\jobs\xxxx\workspace\xx\obj\Staging\Package\PackageTmp\Views\Web.config. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FAILED_TO_ENCRYPT_WEB_CONFIG.)

I can do the deployment from Visual Studio but with same arguments Jenkins is not working.

One more question I use entity framework code first approach. Do I need to do anything in Jenkins to run the migration scripts.

If I do MSDeployPublishMethod as FileSystem it is deploying but migration scripts are not running.

Thanks


回答1:


Later I found that my publish profile had /p:MSDeployEnableWebConfigEncryptRule=True.

MS build ignored the command line argument.



来源:https://stackoverflow.com/questions/24374824/failed-to-encrypt-destination-web-config-when-using-ms-build-plugin-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!