Got an annoying problem here. I\'ve got an NHibernate/Forms application I\'m working through SVN. I made some of my own controls, but when I drag and drop those (or view som
Update: Unfortunately, i don't know how of a way to get your solution folder at design time. So, technically, I am not answering your question, just offering a potential workaround.
You can check if your control is in DesignMode
and if it is, you can use Assembly.GetExecutingAssembly()
to get the Assembly
for your control and determine the location it was loaded from.
Note that there are some caveats with the DesignTime
property value, namely if your designing your control or if you are designing a Form that contains your control, it'll return properly true, but if you are designing a form that contains a control that contains your control, it'll retun false.
You might want to skip the whole DesignTime check because of this and always look for the NHibernate config in the base path of your assembly, if your standard way to find that config file fails.