Today I was working with a WPF project and when I went to run the application I got the following error 'Cannot locate resource 'FileName.xaml'. Note, this is NOT a compiler error, this is a runtime error.
When I opened up the App.xaml file, the StartupUri appeared to be correct, but I would still get this error. After playing around for a few minutes it dawned on me what the issue is.
Let me explain:
In my project I created a subfolder to put my views (forms) into. I named this folder 'Views'. Example:
Turns out that in order for the StartupUri to find the xaml form, you need to provide the file path of the file, not name the namespace path of the file. When I did that it all worked.
None Working StartupUri
Hope this helps
Till next time
08-05-2007 9:56 AM