I recently ran into an interesting aspect of WPF applications that I had not previously seen. It started with this error:
Program 'DemoCorp.UI.exe' does not contain a static 'Main' method suitable for an entry point
I had copied an App.xaml file from an existing application into a new application I was creating, because I wanted the resource definitions and thought that would be an easy way to do it. I then deleted the App.xaml that was automatically generated in the new application, which created the compiler error above.
As it turns out, there's a special output type for the App.xaml file to make it generate the Main method. Here's an App.xaml in the solution explorer:
If you click on the properties tab to get the file properties for the App.xaml, you'll see something like the following:
To generate a suitable Main method, the Build Action must be set to ApplicationDefinition as shown in this image. As soon as I figured this out, everything worked great.