Click here to Skip to main content
15,908,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 ??
Posted

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:
XML
<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>
 
Share this answer
 
Go to add new items -> online templates and then choose 'Silverlight Application Class'.
This will add a new app.xaml for you.
 
Share this answer
 
Comments
Hazem Elamir 4-Aug-18 15:32pm    
can't find in online templates the silverlight application
Also don't forget to:
set Build Action to ApplicationDefinition
(in properties of the App.xaml)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900