# Saturday, October 13, 2007
« Continuous Integration and Version.txt | Main | Killing System.Process and it's Child Pr... »

Today our product manager was trying mocking up some new UI elements in Visual Studio 2005 when he came to me with this error, "one or more errors encountered while loading the designer."  This is something that probably doesn't come up very often, or at least I hope not - especially in this specific case.

In our WinForms application we have a custom resource manager that the main form uses.  This custom resource manager makes use of a MarketSegment class which is created based off a setting in the app.config via the MarketSegmentManager class.  This market segment object is used to conditionally load resources depending on the current market segment selected in the app.config.  This way we can display different text and graphics depending on the current customer's segment.

Apparently when the Visual Studio designer builds and then runs, it doesn't give your code access to the app.config - at least when its loading resources.  I ended up having to change our MarketSegmentManager class to return a default MarketSegment object when the app.config setting was read in as null - like when its running under the VS designer.  I don't really like this because it is anything but fail fast, but its better than not having the VS winform designer.

Comments are closed.