从开发移动到云时,从一个ConnectionString中切换到另一个 [英] Switching from one connectionstring to another when moving from development to cloud

查看:78
本文介绍了从开发移动到云时,从一个ConnectionString中切换到另一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的云应用程序。当我考出我想要有作为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:

<一个href=\"http://stackoverflow.com/questions/4224040/visual-studio-2010-can-apply-debug-or-release-transformations-to-web-config-but/4226683#4226683\">Visual Studio 2010中可以应用调试或发布转换来的Web.config,但对于Azure的设置?

这篇关于从开发移动到云时,从一个ConnectionString中切换到另一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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