.Net Core Web API in .Net Core Console App as Windows Service RRS feed

  • Question

  • User-606447379 posted

    Hello Guys,

    As a part of one of my requirement , i need to migrate .net Framework windows service to .net core. Into the old service , i am using web api as well to exposed the data through endpoints. However after migrating to .net core console application as windows service with .net compatibility pack , i am not able to call the web api.

    So can anyone please help me that how can i add .net core web api with windows compatibility pack in the application which will be a .net core console application ?

    Tuesday, July 16, 2019 3:22 PM

All replies

  • User-474980206 posted

    not sure your question. all .net core webapi applications are console apps. you probably want to go the other way, create a .net core webapi app, then add the computability pack (though at this point I'd probably use core 3.0)

    Tuesday, July 16, 2019 7:22 PM
  • User-1764593085 posted

    Hi ankurparekh_core,

    Why are you adding api controller on console application. As bruce has said. you can add new webapi project and create your api controller in it instead. Then you can consume api in console project.

    Best Regards,


    Wednesday, July 17, 2019 5:31 AM