Click here to Skip to main content
15,886,791 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I started getting the error above after refactoring the code by pulling out project child folders into the root of each project and renaming the namespaces to reflect this change.

I've repeatedly set the main project containing the shell and bootstrapper as startup project but the solution doesn't even seem to acknowledge the presence of prism or that I intend it to fire up the solution rather than explicitly setting a Main method.

What I have tried:

I've looked at the sample prism projects from msdn and there's no mention of a Main method either.

I've reread the docs, as well as this https://www.dmcinfo.com/latest-thinking/blog/id/9295/a-properly-pleasing-prism-primer--part-2-the-shell and a number of stackoverflow threads but none seem to address prism programs looking for a Main method.

However, I observed that in the project properties of one the sample projects, in the startup object section, the App class appears in the dropdown (even though it's not set as the startup object anyway).

I have uploaded the solution to this drive. Thanks
https://drive.google.com/open?id=1TEBjci71xGyAQaklczXGf5BM84oZK4aL
Posted
Updated 20-Apr-20 5:19am

1 solution

Your SchoolPrism .proj file looks strange because it contains an empty
StartupObject
tag:

XML
<PropertyGroup>
  <StartupObject>
  </StartupObject>
</PropertyGroup>


I cannot test this right now but you could either try to set:
1) App.xaml in the start-up project option or
2) Remove the tag (as it should find the App.xaml by default) or
3) re-create the SchoolPrism project only this time making sure its based on a WPF Application template (you might have used a Winforms template?)
 
Share this answer
 
Comments
nmeri17 8-Aug-18 4:45am    
Hi. I have all three of your solutions and the results are as follows:
3) The project is a valid WPF project, according to this https://www.mztools.com/Articles/2008/MZ2008017.aspx
2) Didn't work
1) Added SchoolPrism.App and it doesn't request for a Main method anymore. The startup dropdown identifies it as well.

The app does run now but still crashes with the error "error CS1558: 'App' does not have a suitable static Main method". So I fixed it with the accepted answer here https://stackoverflow.com/questions/577298/program-does-not-contain-a-static-main-method-suitable-for-an-entry-point. Many thanks, Dirk!

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