WP7 APP.XAML 删除后,再添加后无法运行
这个问题搞了一上午也没搞定 最后看到CODEPROJECT看到别人回的贴子:(地址:
http://www.codeproject.com/Questions/376431/WPF-App-Xaml-how-to-add-it )
Hi all i have a problem maybe it is not logical but it does happen with me.
I am working on a wpf application and for a reason i did remove App.Xaml and add app.cs witch contain main method.
and the application is working very well, but i need to add a resource dictionary and i did found that it will be add in App.Xaml in order to use it in all project window,
but now i don't have App.Xaml, i did Add one manualy but it was not working it is not like the generated one .
any one can help me to add one without creating the project ??
别人回答的
1)Go to add new items -> online templates and then choose 'Silverlight Application Class'.
This will add a new app.xaml for you.
2)The reason that it is not working properly is because when you removed the App.xaml file, Visual Studio loses that as the Startup object in the project properties. If you have created the App.xaml file (I add a default one here), then you go to Project Properties > Application > Startup Object and you choose your App.xaml file in the drop down. Here's the default XAML file:
<Application
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="[mainpage].xaml">
<Application.Resources>
</Application.Resources>
</Application>