问题描述
我工作的云应用程序。当我考出我想要有作为ServiceConfiguration.cscfg如下我的连接字符串设置在我的电脑上的应用:
I am working on a cloud application. When I test out the application on my computer I want to have my connection string set as follows in ServiceConfiguration.cscfg:
<Setting name="DataConnectionString" value="UseDevelopmentStorage=true" />
当我发布到云计算,我需要有它设置如下:
When I publish to the cloud I need to have it set as follows:
<Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=xxxx;AccountKey=yyy" />
我一直从一个环境到另一个去,并保持不必更改DataConnectionString。
I keep going from one environment to the other and keep having to change the DataConnectionString.
有没有办法,我可以自动完成这一办法?我环顾四周,看不到任何的例子,但我敢肯定,一些人有同样的问题我。
Is there a way that I can automate this? I looked around and can't see any examples but I'm sure some others have the same problem as me.
谢谢,
南希
推荐答案
我在这里回答了一个类似的问题:
I've answered a similar question here:
Visual Studio 2010中可以应用调试或发布转换来的Web.config,但对于Azure的设置?
这篇关于从开发移动到云时,从一个ConnectionString中切换到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!