web.config中改变(显着)Azure的部署过程 [英] Web.config altered (drastically) during Azure deployment

查看:161
本文介绍了web.config中改变(显着)Azure的部署过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

部署到Azure中后,我一直得到服务器错误 - 应用程序将无法运行。所以,我做了一个远程桌面到实例,发现web.config中被彻底大修......这是怎么回事?我以为web.config中被打包成-是什么?取而代之的是,整体结构已被替换。当我与原来的,不变的,正确的配置取代新版本,我的应用程序按预期工作。

After deploying to Azure, I kept getting server errors -- the application would not run. So I did a remote desktop into the instance and found that the web.config was completely overhauled...what's going on? I thought web.config was packaged as-is? Instead, the entire configuration has been replaced. When I replace the "new" version with the original, unaltered, correct configuration, my app works as intended.

首先,这是怎么回事吗?我究竟做错了什么?这样我可以理解,而不是复制此在未来。

First off, what's going on here? What am I doing wrong? This way I can understand and not replicate this in the future.

其次,我该如何制止这种行为?我想部署的原始web.config中 - 而不是一些任意冒名顶替者。谢谢!

Secondly, how do I stop this behavior? I want the original web.config deployed -- not some arbitrary imposter. Thank you!

推荐答案

根据dunnry的建议解压缩文件cskpkg,我注意到,在web.config从未甚至包装 - 所以必须天青已经创建了一个基本的必要性(无警告我!?!?)。经过一番调查,我碰到这个金块就(从<一个href=\"http://stackoverflow.com/questions/9570016/azure-asp-net-mvc-web-config-deployment-issue\">another StackOverflow的问题解决部署问题):

Based on dunnry's suggestion to unzip the cskpkg file, I noticed that the web.config was never even packaged -- so Azure must have been creating a basic one out of necessity (without warning me!?!?). After some investigation, I came across this nugget (from another StackOverflow question addressing deployment issues):

原来甚至没有被列入部署包的web.config文件。不知怎的,web.config文件的BuildAction的得到了从内容到无改变。

Turns out the web.config file wasn't even being included in the deployment package. Somehow the BuildAction of the web.config file got changed from Content to None.

改变BuildAction的回内容后,我现在部署按预期工作。

After changing BuildAction back to "Content" my deployment now works as expected.

这篇关于web.config中改变(显着)Azure的部署过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆