XAML is not updating when debugging on a WP8 device

你。 提交于 2019-12-13 12:06:50

问题


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.


回答1:


Does the project name contain (or the folder it is in) any spaces? In my case, removing the spaces solved the problem.




回答2:


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.




回答3:


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



来源:https://stackoverflow.com/questions/17946879/xaml-is-not-updating-when-debugging-on-a-wp8-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!