如何在调试模式下更改灯开关应用程序的连接字符串 [英] how to change the connectionstrings of a lightswitch application in debug mode

查看:24
本文介绍了如何在调试模式下更改灯开关应用程序的连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请我如何更改灯开关应用程序的连接字符串以进行调试.我已经关注了这篇文章http://dougseven.com/2010/08/23/data-storage-in-visual-studio-lightswitch-2/

please how do i change the connection string of a lightswitch application for debugging purposes . i have followed this post http://dougseven.com/2010/08/23/data-storage-in-visual-studio-lightswitch-2/

但我似乎可以让它工作.每当我在调试模式下运行应用程序时更改 applicationroot/bin/debug 中的 web.config 时,该文件都会使用文件中的原始值重新创建.

but i can seem to get it to work. anytime i change the web.config in the applicationroot/bin/debug when i run the application in debug mode the file gets recreated with the original value in the file.

我在发布应用程序时更改它没有问题.

i have no problem changing it when publishing the app.

当我在 applicationdefinition.lsml 文件中实现更改时,它没有任何效果

and when i implement the change in the applicationdefinition.lsml file it has no effect

推荐答案

来自 Andy Kung 灯光开关团队:

如果您附加到外部数据源,则可以右键单击该数据源解决方案资源管理器中的节点,选择更新数据源"进行修改无需重新创建屏幕即可获取服务器信息.

If you attach to an external datasource, you can right click on that node in the Solution Explorer and select "Update Datasource" to modify the server info without recreating your screens.

已编辑

...但不是真的.

您应该更改 applicationroot/ServerGenerated/Web.config 而不是 applicationroot/bin/debug/web.config.

You should change applicationroot/ServerGenerated/Web.config instead applicationroot/bin/debug/web.config.

说明:

如果您转向文件视图,则在 Data/ApplicationDefinition.lslm 中,它们是对您的连接字符串的引用:

If you turn to File View, in Data/ApplicationDefinition.lslm they are a reference to your connection string:

然后在 project\ServerGenerated\Web.config 中找到连接字符串:

Then in project\ServerGenerated\Web.config locate the connection string:

<connectionStrings>
    <add name="_IntrinsicData" ... />
    <add name="e8f0cfed-653d-42fc-9617-bcaee11eed91" connectionString="HERE!!!!!!

这篇关于如何在调试模式下更改灯开关应用程序的连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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