Can't load assembly with reflection when using data binding in WPF
Posted on 2011-09-15
When using a Window.Resources element to instantiate a custom class contained in a name space it can't be instantiated.
This seems to be because of using reflection in the custom class' constructor to dynamically load a class in an unreferenced assembly (I did not want to have to have it referenced because of possibly wanting to replace it with a diff implemntation of the assemby in the future).
The given reason for this problem is because the unreferenced assembly can't be found. Of course, I verified that the so-called missing assembly truly is in the bin\debug\ directory. The real problem is because the designer is apparently looking for the assembly at "file:///C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\" instead of the bin\debug directory. I tried it in VS2010 but it fails for the same reason except it is looking for the dll in the directory where the "sln" file is located.
Why is Visual Studio looking for the DLL in those directories instead of the local directory debug\bin directory?. Oh, btw it executes fine as an executable, it's just that the designer can't refresh in VS 2008. Is there some sort of config option I need to adjust?