self-hosting

What URL does OWIN understand for ipv6 self-hosting?

放肆的年华 提交于 2019-12-05 01:41:43
My application uses self-hosting feature of ASP.NET Web API . NuGet package name I use is Microsoft.AspNet.WebApi.SelfHost. I used following example as a base. Following code works for me to launch host on ipv4 localhost endpoint: WebApp.Start<Startup>("http://127.0.0.1:43666"); What do I enter if I want to specify ipv6 address? "http://[::1]:43666" does not work. Exception thrown is [reformatted]: System.Net.HttpListenerException: The network location cannot be reached. For information ..about network troubleshooting, see Windows Help at System.Net.HttpListener.AddAllPrefixes() at System.Net

asp.net web api self hosting / owin / katana

徘徊边缘 提交于 2019-12-05 01:34:39
There are multiple question I have around self-hosting Self Hosting Nuget There are 2 nuget which provide self hosting : Microsoft.AspNet.WebApi.OwinSelfHost and Microsoft.AspNet.WebApi.SelfHost , so does microsoft have 2 implementation of self hosting?? or they are same?? Owin or Kitana the name of nuget is Microsoft.AspNet.WebApi.OwinSelfHost has OWIN, but as far as I read Owin is an interface and Kitana an implementation, what is the name of the nuget for implementation?? Hosting in Production I have managed to run the example by creating a console. But when deploying to prod, how to deploy

ServiceStack Selfhosted Application Restart

ぃ、小莉子 提交于 2019-12-04 12:58:08
How can I restart a ServiceStack self hosted Apphost? Setting my AppHost instance to null and disposing of it does not work correctly, it throws the following Exception: System.ArgumentException: An entry with the same key already exists. I need to be able to do this to reload settings and start the AppHost without restarting the Windows Service hosting the AppHost EDIT: Scott and Moo-Juice's suggestions to run the AppHost in a different AppDomain is the correct solution. In order to get past the Cross Domain calls to restart the AppHost, I created a second AppHost which runs in the Main

SSL: NancyFx Selfhost Mono Linux (pi)

纵然是瞬间 提交于 2019-12-04 07:40:30
I am new to linux (PI) and mono, applogies for the newbie question How do I run NancyFx, shelf host, over https, on mono/linux/pi? If i am able to create a certificate using OpenSsl (cer file), how do I assign it to a port? in the docs show how to do this for windows (here https://github.com/NancyFx/Nancy/wiki/Accessing-the-client-certificate-when-using-SSL#configuration-of-hostingself ) thanks I have no knowledge of PI at all, but I assume it's not much different than hosting on any other variant of linux. There's two ways. The first is documented on the Wiki: https://github.com/NancyFx/Nancy

Host Web API as Windows Service using OWIN

不羁的心 提交于 2019-12-04 03:52:19
I'm trying to run a Web API application as a Windows Service using OWIN. However, I get the following message, when trying to start the service: The [ServiceName] service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs. For some reason my service doesn't understand that it should keep listening to http://localhost:9000 The VS solution consists of two projects: The Web API and the Windows service. In the Windows service project I have: static class Program { static void Main() { ServiceBase[] ServicesToRun;

“System.MissingMemberException: The server factory could not be located” starting Microsoft.Owin self-hosted in TeamCity

怎甘沉沦 提交于 2019-12-04 00:10:37
When Teamcity runs an integration test that starts a self-hosted webapplication, the test fails with the error: System.MissingMemberException: The server factory could not be located for the given input: Microsoft.Owin.Host.HttpListener The code throwing this error is: var webApp = WebApp.Start<Startup>("http://*:52203/") The test runs fine when executed withing Visual Studio (using the Resharper test runner). Teamcity is configured to use the JetBrains.BuildServer.NUnitLauncher.exe executable to run the test. I see a lot of posts regarding this error are to do with the because the Microsoft

Get current owin context in self host mode

别等时光非礼了梦想. 提交于 2019-12-03 12:00:30
问题 I need to run my application which provides some ASP.NET Web API services on both IIS and .NET CLR self host modes. I developed my ASP.NET Web API services based on OWIN and it is working fine on both hosts. For now I need something like this: public class OwinContextInfrastructure { public static IOwinContext Current { get { if (HttpContext.Current != null) { return HttpContext.Current.GetOwinContext(); } else { // What should I do here ? return null; } } } } to get current owin context

Managing evolutions in production environment

[亡魂溺海] 提交于 2019-12-03 08:11:10
问题 We are in the process of deploying a new application using play 2.1.1 to production and are having some real issues with it and the very limited documentation didn't help much... So it was time to update to a new version, we ran our usual stop/upgrade/start scripts but they failed. For some reason, play was refusing to apply the evolutions. When starting it kept saying Oops, cannot start the server. @6elnj89fh: Database 'default' needs evolution! This was even though we tried setting

Get current owin context in self host mode

喜欢而已 提交于 2019-12-03 02:28:19
I need to run my application which provides some ASP.NET Web API services on both IIS and .NET CLR self host modes. I developed my ASP.NET Web API services based on OWIN and it is working fine on both hosts. For now I need something like this: public class OwinContextInfrastructure { public static IOwinContext Current { get { if (HttpContext.Current != null) { return HttpContext.Current.GetOwinContext(); } else { // What should I do here ? return null; } } } } to get current owin context whenever I need in my application. My code is working fine on IIS, but what should I do in .NET Self Host

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

时光总嘲笑我的痴心妄想 提交于 2019-12-03 00:57:30
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 the excepted "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.28 Safari/537.31", I only get "Mozilla/5.0". I've tried: var header = request.Headers.SingleOrDefault(h => h.Key == "User-Agent").Value.First(); var header = request.Headers.UserAgent.SingleOrDefault().Product.ToString(); var header = request