Questions tagged [self-hosting]

Operating independently of a hosting infrastructure

Self-hosting refers to a program or service which does not require a hosting environment. This term is often used to describe WCF web services that do not require IIS as their web host - a self-hosted WCF service establishes its own HTTP endpoints and listeners and is responsible for its own routing, security, and configuration management.

772 questions
78
votes
8 answers

Remotely connect to .net core self hosted web api

I have a simple .net core web api with one action: [Route("[action]")] public class APIController : Controller { // GET api/values [HttpGet] public string Ping() { return DateTime.Now.ToString(); } } If I run this via…
Calanus
  • 25,619
  • 25
  • 85
  • 120
53
votes
8 answers

Run WCF ServiceHost with multiple contracts

Running a ServiceHost with a single contract is working fine like this: servicehost = new ServiceHost(typeof(MyService1)); servicehost.AddServiceEndpoint(typeof(IMyService1), new NetTcpBinding(),…
Sam
  • 28,421
  • 49
  • 167
  • 247
47
votes
5 answers

Trying to get the user-agent from request in asp.net web api self host

I'm trying to get the user-agent in a web api self host and I'm either doing it wrong, or the web api itself is altering the user agent string. I've tried using several methods to the get the string and they all return the same results, instead of…
casualtek
  • 531
  • 1
  • 4
  • 7
42
votes
7 answers

Can I host my wordpress blog on github pages as a static webpage

I would like to make my WordPress blog installed on Localhost to push into GitHub and run that on GitHub as a static page. Can I do it, and if yes please give me a detailed answer with the steps and problems involved? I don't care if my page is…
Hari
  • 437
  • 1
  • 4
  • 3
39
votes
3 answers

self hosting asp.net mvc

Is it possible to self host asp.net mvc inside another application ie. console, windows forms, service etc etc. I'd like to build an app that offers a web interface to control it and I'd like to use asp.net mvc for the web part of it. I did take a…
Daniel Powell
  • 8,143
  • 11
  • 61
  • 108
35
votes
4 answers

System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http::8080

I have created my first self-hosted WCF service. I hosted it in a C# console app but it throws an error: System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http: 8080 When I run Visual Studio 2013 as administrator, then…
user3432348
  • 353
  • 1
  • 5
  • 9
33
votes
2 answers

Web API self host - bind on all network interfaces

How do you make a Web API self host bind on all network interfaces? I have the below code currently. Unfortunately, it binds only on localhost. So access to this server from other than localhost is failing. var baseAddress =…
govin
  • 6,445
  • 5
  • 43
  • 56
28
votes
2 answers

Resolving HttpControllerContext with Castle Windsor

In the ASP.NET Web API, HttpControllerContext instances provide a lot of information about the current environment, including the URI of the current request. If a service relies on such information (e.g. the request URI), it should be possible to…
Mark Seemann
  • 225,310
  • 48
  • 427
  • 736
24
votes
9 answers

ASP.NET Web API Self-Host with Windows Authentication

I am trying to use the ASP.NET Web API Self-Host option with Windows authentication so I can determine the logged on user and ultimately accept or reject the user based on their identity. Here is my console application code: using System; using…
20
votes
1 answer

How to get gzip compression working in WCF 4.5

WCF 4.5 supports GZIP without third party libraries or handwritten extensions. I got it working via TCP Binding, but cannot find a way to get it working via HTTP Binding. my wcf - Service is self hosted in a windows service. Addon: i am not allowed…
NickD
  • 2,672
  • 7
  • 37
  • 58
19
votes
1 answer

Self-host of ASP.NET MVC application

I have a full-working ASP.NET MVC application (consisting of 5 assemblies, .NET 4.5.1, ASP.NET MVC 5.2.2) which runs fine in Visual Studio (which uses IISExpress). I would now like to have a console application which takes the MVC application and…
ZoolWay
  • 5,411
  • 6
  • 42
  • 76
19
votes
2 answers

HttpSelfHostServer and HttpContext.Current

I'm working on a self-hosted ASP.NET web api-application. Everything works fine, but now I'm struggling with HttpContext: I need to save session-informations from the client. But HttpContext.Current is always null. So it's obvious that my…
Richard
  • 741
  • 2
  • 7
  • 17
17
votes
1 answer

Owin self host console application with https support (no web api, no SignalR)

With SslStream and socket, I've developed a https web server from scratch. I can apply a certificate to the stream from C# code and deal with the requests. However, I didn't figure out how to do this with Owin. Does any one know how to bind a…
mind1n
  • 1,196
  • 3
  • 15
  • 34
17
votes
5 answers

How to set default static web page for Katana/Owin self hosted app?

I've set up a web site using an Owin self hosted console app. I'm serving static files with no problem, the 'root' of the static part of the site works properly, and the web API routes work fine also. If I browse to: http://localhost/index.html it…
wilee
  • 601
  • 2
  • 6
  • 19
17
votes
1 answer

Self hosted WCF service in Mono

I am currently working on a C# project which is a console app which has a WCF soap service hosted within it. Below is the code I am using to open the host. var baseAddress = new Uri(Configuration.soapServerSettings.soapServerUrl); var host = new…
Boardy
  • 35,417
  • 104
  • 256
  • 447
1
2 3
51 52