Questions tagged [self-host-webapi]

Questions regarding Self-Host ASP.NET Web API

71 questions
2
votes
1 answer

How to expose .NET self hosted Web API over the Internet

I have a WPF application running on a laptop that is self hosting a Web API on Port 9001 for that laptop's network IP address. I am able to successfully send Http traffic to that port from different machines on my local home network. I need to run…
Jim K
  • 155
  • 2
  • 10
2
votes
1 answer

Is it possible to add a favicon to sefl-hosted web api service?

I have many services that I'm moving from ordinary Web API to Owin/Katana as self-hosted web api services. Because we were somehow using Microservices, we have many small services that would run and all of them had the same favicon.ico that showed…
Nasseh
  • 429
  • 1
  • 4
  • 12
2
votes
1 answer

Hosting WebApi Controllers from a library into IIS

I have some WebApi controllers inside a class library and i wanna host them inside IIS. I know the solution for Self-Hosting inside a console application or windows service but that's only good for local use. How could I resolve the controllers…
Siavash Rostami
  • 1,883
  • 4
  • 17
  • 31
1
vote
0 answers

self hosted ASP.NET Core Web Api capable of starting and stopping

I'm attempting to convert an old WCF service to an ASP.NET Core Web API, making use of the CoreWCF package. A key feature of this existing service is that it's being self hosted by an other application and is able to gracefully start & stop, without…
1
vote
0 answers

How can I stream json data in self hosted ASP.NET Web API

Since IAsyncEnumerable is not available in ASP.NET Web API (.NET 4.8). Is there any alternative so that I can stream json data? I wanted to stream an array of json data instead of sending it as a whole. In .NET Core, I can do the following: …
Lance
  • 2,774
  • 4
  • 37
  • 57
1
vote
0 answers

ASP NET Web API with Mutual TLS authentication on self hosted server

I'm trying to implement a client certification validation on a self-hosted web server. My first attempt was to check if the request contains a client certificate but I'm stuck here because Request.GetClientCertificate() always returns null. This is…
blow
  • 12,811
  • 24
  • 75
  • 112
1
vote
0 answers

AddressAccessDeniedException: HTTP could not register URL http://+:8080/api/ - how to: "netsh http add urlacl" programatically from .NET Process?

I'm working on a project in .NET Framework 4.6.1, C# and WinForms (offline desktop app). I come from web-dev and I'm not very familiar with desktop apps. For part of the app, I am using HttpSelfHostServer to give me API functionality. var…
1
vote
0 answers

How to add integrated windows authentication to self hosted Asp.net web api?

Is it possible to support integrated windows authentication (Kerberos) in a self hosted web api or is IIS an absolute requirement if integrated window authentication is required ? Googling around I did not find a clear answer to this question or any…
1
vote
1 answer

OWIN SelfHost project running WebApi project does not call Application_Start method

I have a solution in Visual Studio 2019 containing two projects: A C# class library (a WebAPI project) A C# console application (An OWIN SelfHost project, referring to project 1) The sole purpose of the SelfHost project is that the WebAPI can be…
1
vote
0 answers

WebRequest System.Net.WebException: Unable to connect to the remote server port number is changed in exception

I have two self-host .Net application using System.Web.Http.SelfHost targeting .Net framework 4.0, both application commnunicate over https. The first application is using port: 3287 and the second application is using port: 3286 when I am making a…
Prashanth
  • 507
  • 5
  • 25
1
vote
0 answers

Owin selfhost - dont allow connections from external machines

I have a c# app that runs as "server" for a client app (Electron). The c# does the data crunching and serves the data over HTTP to the JS client. The webendpoint is implmented using Microsoft Owin and WebAPI. It works very well, however, I do not…
David D
  • 11
  • 1
1
vote
0 answers

Take static file in self hosted Web API

I like to get static file from the project to browser like https://localhost:3440/myFile.txt. I placed the "myFile.txt" in the root directory near App.config file. But due to some reason I got only 404. Any idea? About Application WebAPI project,…
Linoy
  • 1,363
  • 1
  • 14
  • 29
1
vote
1 answer

asp.net webapi selfhost controllers from another project

I have a webapi2 project and I want to selfhost this api in another project and call the methods with a httpClient. Here is my code: namespace TestSelfHosting.Controllers { public class ProductsController : ApiController { [HttpGet] …
Buda Gavril
  • 21,409
  • 40
  • 127
  • 196
1
vote
3 answers

Routing issue in self hosted webapi

In a self hosted webapi console application project, I am not able to hit the SayHello method using http://localhost:9998/api/shri/flows/config. Error: { "Message": "No HTTP resource was found that matches the request URI…
1
vote
0 answers

SelfHost Websocket - Web API vs OWIN Middleware

I'm running an OWIN self-hosted application that hosts a REST API and also allows websocket connectivity for real-time data. I'm using WebAPI to handle the routing and mapping of routes to controllers. When I use Web API to handle the websocket…
Brian Heilig
  • 592
  • 4
  • 16