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>