When you run without the debugger though (or if you disable the hosting process – i.e. uncheck project properties->Debug->Enable the Visual Studio hosting process) the CLR only loads assemblies as they are needed. The basic problem here is that by the time that other resource dictionary is being loaded (which is happening in the InitializeComponent of the Application class since that RD is referenced in the application’s resources), our assemblies have not been loaded yet. So what is happening is that the xaml parser is throwing an exception that igDP:XamDataGrid is an unrecognized type. There are probably other ways of solving this issue but one way is to ensure that our assembly has been loaded before the InitializeComponent of the Application is processed. One way to do this is to go into the Application class (i.e. expand Application.xaml and double click Application.xaml.vb) and do something in the ctor that references our type so the CLR loads our assembly. e.g.
When debugging in VS (with the VS hosting process enabled), the hosting process essentially loads all the referenced assemblies up front (which in this case includes our assemblies). This is why it works when debugging normally. Note, this is not something that we have any control over. It seems like the wpf framework should have ensured that the assemblies referenced by a resource dictionary were loaded.
Another way to deal with this is to create a class derived from ResourceDictionary and create an instance of that in your application's resources instead of setting the Source of a RD. I've attached modified version of your sample that does this. I left the code I listed above in the app but commented out.
here a basic sample for you! please fix this problem thank you. :)
Hello,
I copied and used your style in a sample application and it works as expected. I am using the latest Service Release for 9.2 Please give us more details on your environment/setup so that we can try to isolate the problem.