I have three enviroments for my asp .Net mvc application Local, Development and production. This means i need three webconfig files. The transformation seems to work fine with local and development deployment through a build server but not when deploying to production. It works when i manually publish the site from visual studio 2012.
我的asp .Net mvc应用程序本地,开发和生产有三个环境。这意味着我需要三个webconfig文件。通过构建服务器进行本地和开发部署,但转换似乎可以正常工作,但在部署到生产时则不行。当我从visual studio 2012手动发布网站时它可以工作。
Does it have something to do with the servicConfigurations for the different enviroments?
它是否与不同环境的servicConfigurations有关?
1 个解决方案
#1
14
If you're going to Azure, then you can use publishing profiles. The trick is to chain your config files with your environment settings in Visual Studio.
如果您要使用Azure,则可以使用发布配置文件。诀窍是使用Visual Studio中的环境设置链接配置文件。
There's an overview of publishing profiles here: http://msdn.microsoft.com/en-us/library/ff398069.aspx
这里有关于发布配置文件的概述:http://msdn.microsoft.com/en-us/library/ff398069.aspx
And Scott Hanselman walks through a number of scenarios with chained config files here: http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx
和Scott Hanselman在走过了许多与链接的配置场景在这里的文件:http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx
With those two pieces, there is enough info there to not only manually get the configs transforming, but also to work those into CI.
有了这两个部分,那里有足够的信息,不仅可以手动获取配置转换,还可以将它们用于CI。
Hope this helps, cheers.
希望这会有所帮助,欢呼。
#1
14
If you're going to Azure, then you can use publishing profiles. The trick is to chain your config files with your environment settings in Visual Studio.
如果您要使用Azure,则可以使用发布配置文件。诀窍是使用Visual Studio中的环境设置链接配置文件。
There's an overview of publishing profiles here: http://msdn.microsoft.com/en-us/library/ff398069.aspx
这里有关于发布配置文件的概述:http://msdn.microsoft.com/en-us/library/ff398069.aspx
And Scott Hanselman walks through a number of scenarios with chained config files here: http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx
和Scott Hanselman在走过了许多与链接的配置场景在这里的文件:http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx
With those two pieces, there is enough info there to not only manually get the configs transforming, but also to work those into CI.
有了这两个部分,那里有足够的信息,不仅可以手动获取配置转换,还可以将它们用于CI。
Hope this helps, cheers.
希望这会有所帮助,欢呼。