Visual Studio 2005/2008 WPF bug: App.xaml not found messages
Posted by jpluimers on 2010/06/17
When you do some maintenance on old projects, you sometimes bump into things you have completely forgotten about.
This time it is in Visual Studio 2005, with a WPF app, and messages about App.xml.
Since there are few threads covering this problem, so I’m not sure how many people bump into this.
I know that the problem does not limit itself to C#; I have seen people in VB.NET and Delphi.net bump into this as well.
This problem is not limited to Visual Studio 2005, some people also have it in Visual Studio 2010.
Some people also have it with other objects than App.xaml (like Windows1.xaml, etc).
If you get this error, the solution is simple:
- perform a “Clean Solution”,
- then run your app again.
This trick has worked for me every time I bumped into it.These are the error messages:
System.IO.IOException was unhandled
Message="Cannot locate resource 'app.xaml'."
Source="PresentationFramework"
StackTrace:
at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
at System.IO.Packaging.PackagePart.GetStream()
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at MyNamespace.App.InitializeComponent() in C:\Path\Solution\Application\App.xaml:line 1
at MyNamespace.BootStrap.Main() in C:\Path\Solution\Application\BootStrap.cs:line 22
--------------------------- Microsoft Visual Studio --------------------------- Entering break mode failed for the following reason: Source file 'C:\Path\Solution\Application\App.xaml' does not belong to the project being debugged. Usually, this condition occurs when the project was not rebuilt prior to starting the debugging session, when the assembly file for the project is out of date, or when the project source files were moved to a different disk location between the time the project was built and the debugging session was started. Edit and Continue will be disabled for this debugging session. --------------------------- OK ---------------------------






sugeng said
clean solution what is that ??
jpluimers said
This StackOverflow answer explains what Clean Solution does.