none
WPF App - *.exe does not contain a static Main method suitable for an entry point. RRS feed

  • General discussion

  • ABILITY TO REPRODUCE ERROR:
    Consistently.
    Can do with new empty project.
     
    STEPS TO REPRODUCE ERROR:
    1) "File" => "New" => "WPF Application project"
    2) Select App.xaml file
    3) <Notice that the "Build Action" of the properties in SE corner says       "ApplicationDefinition" >
    4) Right click and "Exclude from project"
    5) Right click, "Add" => "Existing Item" => pick App.xaml
    6) When compiles, results in error:

    ERROR:
    Program 'C:\dev\loyalty\loyaltysuite\trunk\source\.NET Components\WpfApplication2\WpfApplication2\obj\x86\Debug\WpfApplication2.exe' does not contain a static 'Main' method suitable for an entry point WpfApplication2

    CAUSE:
    For some reason, Visual Studio IDE changes the BuildAction=Page on the App.xaml file 
    without you doing anything then is not happy when it was the one that changed it.

    FIX:
    Make sure that the property of BuildAction=ApplicationDefinition on the App.Xaml.  

    Tuesday, March 8, 2011 10:18 PM

All replies

  • We are facing this error:

    Error 1 Application main file must be named App.xaml C:\Users\abc\Documents\Visual Studio 2012\Projects\abc\abc\Test.csproj

    Overview:

    We have 2 projects : Project1 and Project2

    We are trying to launch Project1 from Project2 by deleting the Project2 app.xaml and adding Project1 App.xaml as a link. Then changing BuildAction=ApplicationDefinition of app.xaml under project1.

    After doing this we are getting this error:

    Error 1 Application main file must be named App.xaml C:\Users\abc\Documents\Visual Studio 2012\Projects\abc\abc\Test.csproj

    Hi Eric, do you know how can we launch Project1 from Project2 ?

    Thanks

    Tuesday, August 7, 2012 10:45 AM
  • Thank you so much


    BY Amal

    Wednesday, November 21, 2012 1:56 PM