另一个“指定的命名连接”参数异常错误

发布于 2024-11-13 07:48:08 字数 297 浏览 4 评论 0原文

我已经阅读了一些对此的回复,我需要将 DAL 项目的 app.config 复制到我的 exe 项目。这样做了,所以这不是问题。

非常奇怪的是我的应用程序启动并运行良好,没有任何问题。我在运行时没有得到这个。

我在设计时在 xaml 设计器中收到此错误。不仅如此,我上次参与这个项目时一切都运行良好。我已经好几天没碰它了。然后我启动 VS2010 来处理它,现在出现这个错误。

为了澄清起见,我有一个带有选项卡的主窗口,每个选项卡项都被分成一个带有自己的视图模型的单独的用户控件。

有什么想法为什么会发生这种情况吗?

I've read several responses to this that I need to copy the app.config of my DAL project to my exe project. This is done so this is not the problem.

What is very strange about this is that my app starts and runs fine with no problems. I do not get this at run time.

I am getting this error in the xaml designer during design time. Not only this, but everything was working fine that last time I worked on this project. I haven't touched it for a few days. I then fired up VS2010 to work on it and now I have this error.

For clarification I have a main window which has tabs and each tab item is split off into a seperate user control with their own view model.

Any ideas why this is happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱她像谁 2024-11-20 07:48:08

如果控件(或代码隐藏)中的代码尝试访问数据库(或设计时不可用的其他资源),我已经看到过类似的情况发生。然后在设计时 Visual Studio 运行该代码并出现错误。检查这是否是您正在做的事情。弄清楚它发生在哪里的一种方法是尝试删除一堆控件,看看它是否有效(旧的消除过程)。

编辑:检查您是否处于设计模式:

if (!DesignerProperties.GetIsInDesignMode(this))
{
    // Your code that breaks in DesignMode
}

请参阅此 MSDN 链接以获取更多信息:http://msdn.microsoft.com/en-us/library/system.componentmodel.designerproperties.getisindesignmode.aspx

I've seen things like this happen if code in a control (or code-behind) is trying to access the database (or other resources that aren't available at design time). Then at design time Visual Studio runs that code and gets errors. Check if this is what you are doing. One way to figure out where its happening is to try deleting a bunch of your controls away and see if it works (the old process of elimination).

EDIT: To Check If You Are In Design Mode:

if (!DesignerProperties.GetIsInDesignMode(this))
{
    // Your code that breaks in DesignMode
}

See this MSDN link for more info: http://msdn.microsoft.com/en-us/library/system.componentmodel.designerproperties.getisindesignmode.aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文