Recently I came across a strange issue. It would seem the WPF XAML designer for some reason wants to traverse through My Music folder.
While I am flattered the XAML Designer might be interested in “My Music”, I’m not amused that the designer actually crashes and shows this error:
So what to make of this one? One minute I’m working normally in WPF, and the next this thing pops up and prevents me from meeting my deadline.
Google should know right? Wrong! Nothing much there besides a few other people who have come across this, and are frustrated as hell, left wondering if WPF and XAML is more of a prototype than an actual development tool.
So I decided to ask the question on Stackoverflow except the fine people over there didn’t appreciate my question. Neither did they think I deserved to ask the question:
So around this point in time, I have no idea what the problem is and the internet seems less than helpful. Now I know sooner or later, maybe even right now there is some other poor jerk having the same problem – who doesn’t have the luxury of Microsoft Gold Support.
That is why I am writing this, I’m going to try and investigate this problem and document my investigation process.
The first thing I wanted to do is find out if it is a problem with just 1 XAML file or ALL XAML files in my project.
This is easy enough to do, I tried opening a few XAML files, all of them worked 5 minutes ago, none of them work now. Clearly this means:
Conclusion(s) : Not the XAML markup causing the problem.
It is a system wide problem, or just a solution / project problem.
I created a new Grid Application. Lo and Behold the XAML editor worked just fine.
Conclusion(s) : It’s something in the solution or project causing this.
Permissions of the folder the project is in?
Added: ALL APPLICATION PACKAGES user to the folder my project is in : C:\Projects\XYZ…
Added : My own account to the folder (even though I am administrator) and assigned full control
Conclusion(s) : Don’t think its permissions can’t really be sure though (maybe I missed something?)
Create a copy of the solution and project, and try and tear it apart to see what is wrong.
So I create a copy of C:\Projects\XYZ -> C:\Projects\ABC….
Now where to start tearing this thing down?
Well for starters the new copied solution and project throw the same error.
4.1 Delete images in \Images dir. (I know its a bit lame, but last thing I did was add an image, so let’s see)
4.2 Delete fonts – Yes I had some embedded fonts, Maybe that is the problem?
4.3 Mmm maybe it’s time to start looking at references.
4.3.1 Removed: WPFAnimatedgif.dll
So its a reference that does this…. But I actually need that. So I have an idea…
I downloaded that DLL to myDocuments. I’m going to move it to my project directory instead and reference it from there.
Ladies and geeks, Do not reference a DLL from MyDocuments folder.