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 is looking for the static Main method in Program.cs and I am getting:
C:ProjectsSomesrcSome.Coreerror CS5001: Program does not contain
a static 'Main' method suitable for an entry point
I am assuming that there should be only one Program.cs / entry point for the overall solution, and that is sitting inside of my WebApi project. Am I incorrect? Otherwise, how do I resolve this error? I falsely assumed that "emitEntryPoint": true
served this purpose.
Here is an example of my class library's project.json:
{
"version": "1.0.0-*",
"description": "Some.Core Class Library",
"buildOptions": {
"emitEntryPoint": true
},
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Authentication.JwtBearer": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Routing": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.Identity": "1.0.0",
"Microsoft.Extensions.Configuration": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Configuration.UserSecrets": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0"
},
"frameworks": {
"netstandard1.6": {
"dependencies": {
"NETStandard.Library": "1.6.0"
}
}
},
"runtimes": {
"win7-x64": {}
}
}
Suggestions appreciated.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…