Error CS5001: Program does not contain a static 'Main' method suitable for an entry point

Viewed 191

Sorry for the potentially dummy question. I'm trying to migrate my existing UWP using Uno. I followed the tutorial to create the Uno app project, copied all files as explained and tried to build the project. However, the build fails with the error:

CS5001: Program does not contain a static 'Main' method suitable for an entry point.

The build action for app.xaml in the shared project is ApplicationDefinition (default). Did I miss something in the tutorial? I face the same issue if I build the default uno template. The version of both Micrsoft.Extensions.Logging.Console and Filter is 1.1.1, I only updated Uno nugget packages as suggested in the tutorial.

Thank you!

1 Answers

You'll need to make sure that:

  • The shared project is referenced by the UWP project
  • That App.xaml is of 'Build action' ApplicationDefinition (which you did)
  • The default namespace of the UWP project is matching the namespace specified in the App.xaml.cs and App.xaml files

Other than that, you can check in the obj folder for any file named App.xaml.g.cs or similar for the content and clues about what's not generated properly.

Related