Questions regarding Self-Host ASP.NET Web API
Questions tagged [self-host-webapi]
71 questions
1
vote
1 answer
task returned by IHttpActionResult.ExecuteAsync() overload is not run
I'm trying to create a self-hosted Web service that starts its server with Microsoft.Owin.Hosting.WebApp.Start("http://localhost:9000/") and contains a controller derived from System.Net.Http.ApiController. NotifyStartup looks like…
user1877240
1
vote
0 answers
Access IOwinRequest in Self Hosted Web API Outside of a Controller
I have a self hosted web api. I have a log builder helper that populates a LogMessage object with a lot of details from the IOwinRequest object (i.e. requested url, ip address, http method, etc). I use this log helper to populate all of these…

jkruer01
- 2,175
- 4
- 32
- 57
1
vote
1 answer
Nuget install local package fails when referencing external package has metadata only (no lib)
I am trying to build a local package with Nuget. My library uses several installed packages including "Microsoft.AspNet.WebApi.OwinSelfHost". The OwinSelfHost package only has a .nupkg file and not a corresponding lib or content folders. Nuget…

Kevin
- 43
- 5
1
vote
1 answer
Azure Service Fabric with OWIN self-host listener
In one of my stateless service I would like to include two listeners:
Listener provided by Service Fabric for internal communication between services
Listener based on OWIN Self-Host implemented according to examples…

Przemek Marcinkiewicz
- 1,267
- 1
- 19
- 32
1
vote
1 answer
WebApi hard coded controller routing
I am trying to write a self hosted WebAPI server. I want all routes to go to a single controller. This controller can pick out the controller part of the url and use this to decide an appropriate response.
I have the following route…

K-Dawg
- 3,013
- 2
- 34
- 52
1
vote
0 answers
how to pre-load data upon application startup in an OWIN self-hosted applicatgion
I have a need to pre-load some Entity Framework data upon application start up in my OWIN / TopShelf self-hosted application.
What is the technique for initializing the EF DbContext, and pulling up data, as this self=hosted app starts up?
Should…

Eugene Goldberg
- 14,286
- 20
- 94
- 167
1
vote
0 answers
KeyNotFoundException when using custom IHttpControllerSelector
I'm trying to use a custom controller selector for my Web API 2.2 project that uses namespace selection for versioning. The project is self hosting.
There are many articles regarding this on the internet, but most of them cover only one use case…

Kasbolat Kumakhov
- 607
- 1
- 11
- 30
0
votes
0 answers
How to share data between self-hosted Web API and server
I have created a simple self-hosted web api and a server that is basically a windows service.
Service has the following code:
protected override void OnStart(string[] args)
{
var config = new…

Usama Alam
- 1
- 1
0
votes
2 answers
How to host a self hosted web api in WPF as Self hosted web api is working fine in Console application
I wanted to host a API in WPF. I have tried implementing Self hosted api using below article.
https://learn.microsoft.com/en-us/aspnet/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api
When i have done the implementation for…

praveena H M
- 178
- 1
- 14
0
votes
0 answers
Checkmarx Issue: Insecure Cookie
In the below code I got a Checkmarx issue of Insecure Cookie/
In the Startup class, I'm using self-host API.
class Program
{
[STAThread]
private static void Main()
{
string Mutex_id = "Recorder";
using (Mutex mutex = new…

Pragyanand
- 1
- 6
0
votes
1 answer
Selfhosted server and SSL communication over TLS
I have an application that hosts WebAPI (HttpSelfHostServer) on windows service.
Communication over SSL (self-signed certificate for localhost).
Now I have two cases:
Windows7 - when calling API method (from the browser for example) I see that TLS…

john_9559
- 41
- 3
0
votes
0 answers
HTTP Post request failing with Internal server error in OWIN Self-Host web api server
I have setup some simple APIs on OWIN self host. On starting the server on my local box everything works as expected, but when I deploy the same APIs on production, the POST API starts failing, while the GET works fine.
[HttpGet,…

RawPodolski
- 33
- 7
0
votes
0 answers
.Net Framework Web Api SelfHost service stopped suddenly
I created a simple Web Api selfHost as windows service which listens to an address which is dynamically loads from the database and normally it includes port number( like : http://localhost:1900)
When I change the address( for example port number,…

Ehsan Shirvan
- 81
- 9
0
votes
1 answer
.NET Framework 4.0 Alternative to Microsoft.AspNet.WebApi.OwinSelfHost
I have an old windows application that runs on .NET Framework 4.0 that now needs to selfhost a web service in order to respond to Web API calls. For that, I tried to setup OwinSelfHost library, but when I try to install through Nuget, I get the…

Chen
- 103
- 1
- 9
0
votes
0 answers
C# SelfHost how to restrict all external requests?
I have a program that works as a background service. It hosts a self-hosted service. But there is an issue. When I host this service it becomes available for all locale network. And, everyone in the same network can get access to this API.
Here is…

Freeedy
- 101
- 3
- 9