开发者

Another "specified named connection" Argument Exception error

开发者 https://www.devze.com 2023-03-09 20:32 出处:网络
I\'ve read several respons开发者_StackOverflow中文版es 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.

I've read several respons开发者_StackOverflow中文版es 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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号