分类 问题记录 下的文章

the same started to happen to me today; to reproduce the issue, I just open Visual Studio 2013 Update 4, create a blank Windows Phone 8.1 and double click on MainPage.xaml.

I solved by performing the following (a mix of what I’ve read around the web):

exit all Visual Studio instances
delete everything on %localappdata%MicrosoftVisualStudio12.0DesignerShadowCache
open a command prompt with admin rights and execute the following commands:
pushd %VS110COMNTOOLS%
icacls ..IDE /grant *S-1–15–2–1:(OI)(F)
icacls ..IDE /grant *S-1–15–2–1:(CI)(F)
icacls ..IDEPrivateAssemblies /grant *S-1–15–2–1:(OI)(F)
icacls ..IDEPrivateAssemblies /grant *S-1–15–2–1:(CI)(F)
icacls ..IDEPublicAssemblies /grant *S-1–15–2–1:(OI)(F)
icacls ..IDEPublicAssemblies /grant *S-1–15–2–1:(CI)(F)
finally, reboot. worked on Windows 8.1 64-bit.

来自 http://stackoverflow.com/questions/24593249/windows-phone-8-app-does-not-contain-a-definition-for-initializecomponent/24772492#24772492