The application works fine, but has "errors" during development: "does not exist in the namespace" and "an error occurred while looking up the resource dictionary"

My application has certain errors in its error field during development to make a resource dictionary with it. For example, in my main window, the resource dictionary is called as follows:

<Window.Resources> <ResourceDictionary Source="Resources.xaml"/> </Window.Resources> 

I get blueline on the middle line: “An error occurred while looking up the resource dictionary“ Resources.xaml. ”However, Resource.xaml is located in the root folder of the project, as well as MainWindow.

I know that there are similar questions like this, however the answers;

"Make sure Resources.xaml is set to action: page"

"Make sure you reference Resources.xaml correctly"

did not help me.

I have an additional problem in that in the resource dictionary I have errors telling me:

 the name ProductDatabaseViewModel does not exist in the namespace "clr-namespace:gate2software.ViewModels" 

and similarly;

 the name ProductDatabaseView does not exist in the namespace "clr-namespace:gate2software.Views" 

in the next xaml;

 <DataTemplate DataType="{x:Type vm:ProductDatabaseViewModel}"> <vw:ProductDatabaseView /> </DataTemplate> 

In fact, both are available exactly where they are claimed.

Any suggestions on any of my two problems are welcome.

0
namespaces visual-studio-2013 wpf resourcedictionary
source share
3 answers

Make sure your path is correct? or try as a path:

 <ResourceDictionary Source=ms-appx:///CustomControls/Resources.xaml> 
0
source share

Have you tried to close the development process (sometimes it works)? Task Manager> Details> XDesProc.exe > End the process. You can reboot it by clicking the update in any VS view, but rebuild everything first.

And by the way, Resources.xaml is probably a ResourceDictionary type, not a Page? Such errors are also displayed when trying to add a page as a resource, and not in a ResourceDictionary.

0
source share

I ran into this problem. My projects focused on x64 build. I changed them to Any CPU . See below and was able to see my model model data during development.

if (Platform Target == x64) throw new NoDesignTimeViewModelSupportException ();

0
source share

All Articles