Questions tagged [self-host-webapi]

Questions regarding Self-Host ASP.NET Web API

71 questions
14
votes
3 answers

How to change the default port in asp.net Core 3 or Net Core 5

when I am in debug, to change the default port, I modify the launchSettings.json file, and change the port "WebApplication1": { "commandName": "Project", "launchBrowser": true, "launchUrl": "weatherforecast", …
10
votes
1 answer

Authenticate HTTP .NET client against Self Host Web API Windows Service

I found great article about client/server implementation via Self Host Web API http://www.asp.net/web-api/overview/older-versions/self-host-a-web-api And I am wondering about the correct authentication method for this model (Self Host Web API…
NoWar
  • 36,338
  • 80
  • 323
  • 498
6
votes
2 answers

Web API self hosted client configuration

I managed to run my self hosted WEP API using OWIN in a console application by starting it with a code like this: //string baseAddress = "http://192.168.1.6:8111/"; string baseAddress = "http://+:8111/"; // Start OWIN host using…
Clock
  • 974
  • 3
  • 17
  • 35
5
votes
0 answers

Owin selffhost web server is slow responding when application has multiple threads running

I have a strange issue with responsiveness of the owin self-host web server in situation when application runs multiple threads. I provided a simple example that demonstrates issue: Web server starts Apllication starts 150 (dummy threads) if you…
Adi
  • 323
  • 1
  • 2
  • 6
5
votes
1 answer

How to enable CORS in asp.net Self-Hosted API?

I created one self-hosted Web API in asp.net it works fine when I call it from POSTMAN but it gives below error when I invoke it from browser. Access to XMLHttpRequest at 'http://localhost:3273/Values/GetString/1' from origin 'http://localhost:4200'…
KEVAL PANCHAL
  • 535
  • 3
  • 14
4
votes
1 answer

Increase request header limit in Web Api OWIN self host

I have a Web Api 2 application hosted in Service Fabric which is using Microsoft.AspNet.WebApi.OwinSelfHost to host the service. My Startup class is pretty typical: public static class Startup { public static void ConfigureApp(IAppBuilder app) …
Dismissile
  • 32,564
  • 38
  • 174
  • 263
4
votes
0 answers

Asp.Net WebAPI WebSockets in self host mode not working

basically I'm trying to do web-sockets in webapi in a self-host manner. Here's an example: class SomeController : ApiController { public HttpResponseMessage SomeAction() { if (HttpContext.Current.IsWebSocketRequest) { …
redb
  • 512
  • 8
  • 22
3
votes
3 answers

Remove Microsoft-HTTPAPI/2.0 from the response header Server (Self-hosted Http.Sys)

How do i suppress or remove the HTTP response header 'Server: Microsoft-HTTPAPI/2.0'? Penetration testing has revealed that it is a security vulnerability to disclose the server platform. I have a self-hosted asp.net core web application running on…
MatiasK
  • 686
  • 1
  • 7
  • 20
3
votes
0 answers

Getting error while implementing oAuth2.0 in C# Console Self Hosted web API

I am getting localhost(portnumber)://signin-google?state=blahblahblah... once google signing in process completed. Below is the main entry point from where API runs. static void Main(string[] args) { using (var app =…
3
votes
1 answer

Create SSL endpoint on port 443 for self-hosted OWIN listener

I am using a self-hosted OWIN listener for a Web API implementation that runs in a local process. However, I am unable to listen on port 443 successfully. The following works: var startOptions = new…
aman
  • 127
  • 2
  • 6
3
votes
1 answer

C# Self Hosted Web - TCP Port used by another application (win10)

Just start to get an exception when trying to use a self-hosted webapi application in Windows 10 1703 (15063.483) VS2017: Version 15.2 (26430.15) Release VisualStudio.15.Release/15.2.0+26430.15 I tried running VS in administrator mode, with the same…
3
votes
1 answer

How to dynamically create Web APIs (REST apis) in selfhosted owin server?

I'm looking for a way to dynamically generate web apis and add them at runtime (after selfhosted server has been initialized). Basically the idea would be to: 1. Create a selfhost owin server serving static/already defined controllers (web apis) ->…
Nick
  • 103
  • 9
2
votes
2 answers

Per-request lifetime for Unity with OWIN WebApi self-host

I am building a WebApi service using OWIN self-hosting (runnable in either console mode or as a Windows service - final deployment to be a service, console mode is for debugging/development). I am having problems with per-request lifetime for Unity…
Zenilogix
  • 1,318
  • 1
  • 15
  • 31
2
votes
1 answer

How to run self-hosted(owin based) web api on IIS?

I have developed self-hosted(owin based) web api using console application. In development phase I was running the console application and everything was okay. static void Main(string[] args) { string baseUri = "http://+:8080"; …
Simple Code
  • 2,354
  • 2
  • 27
  • 56
2
votes
0 answers

OWIN Selfhost with webpack-dev-middleware and webpack-hot-middleware

I wonder if there any nuget package exists for integration of webpack-dev-middleware and webpack-hot-middleware with OWIN Selfhost full .Net46 like for AspNetCore - Microsoft.AspNetCore.SpaServices?
1
2 3 4 5