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

后端 未结 7 1889
[愿得一人]
[愿得一人] 2021-01-04 04:18

I am trying to port my Asp.Net WebApi project, based on the Onion Architecture design approach, over to Asp.Net Core. However, when I build my class libraries, the compiler

相关标签:
7条回答
  • 2021-01-04 04:58

    To avoid the error of "Program does not contain a static 'Main' method suitable for an entry point" in class library, Remove emitEntryPoint from buildOptions-

      "buildOptions": {
        "emitEntryPoint": true
      },
    

    emitEntryPoint tells the compiler whether to create a Console Application or a Library. For more info refer this post

    0 讨论(0)
提交回复
热议问题