I am experiencing a problem when deploying to a Windows Phone 8 device. It seems the XAML is not updating when I do a build and debug. The only way it seems to update is when I do a Rebuild > Debug or uninstall the app then debug.
Here is a scenario:
A page contains a button with a click event named "Button_Click". I debug and everything works. Stop debugging. Now change the event handler's name to NewButton_Click (yes, in both xaml and cs). Start debugging again, click the button and you get an exception because there is no event handler name "Button_Click"
The XAML changes were not detected/pushed to the device, only the Csharp ones were.
If you do a Rebuild then debug, it will work as expected. Rebuilding every time I need t deploy is a PITA because I lose any isolated storage.
Can someone clear up what is happening here?
NOTE: This is happening with a Windows Phone 7.x app in Visual Studio 2012 Update 3 on Windows 8.
Does the project name contain (or the folder it is in) any spaces?
In my case, removing the spaces solved the problem.
I have noticed similar issues with the sample projects from Microsoft. Are you using any strange characters in your file path like '#'? The C# would just break the build. Also, you can try deleting your suo files.
If all else fails, open your /obj/Debug/.../.g.cs and .g.i.cs files. Visual Studio should ask you to reload them if they change.
This is not just a windows phone problem. Ive had this same problem in WPF apps as well. This MSDN Article covers it pretty well for XAP files.
Here is the suggestions:
•Has been set on the target XAP file the readonly properly (source
code version software)
•Had your environment a Memory overflow exception during compilation?
•Is your Silverlight project linked to a web application in the
solution? If not try to do that; if yes...
•Are you compiling only
the silverlight project or the web?
•Have you verified that you are not having a Caching problem with your
browser AND / OR IIS or web host?
•Was the silverlight XAP file being used in that especific moment?
The solution that resolved the OP problem in this article was installing an updated version of Silverlight for VS