Questions tagged [self-host]

1

votes
0

answer
139

Views

Hangfire Dashboard: why missing localization?

I'm trying to localize Hangfire Dashboard (inside a self-hosted console OWIN application, .NET Framework 4.6.1). What I don't understand is why it displays right CurrentCulture and CurrentUICulture settings, but still default labels? And why are some other labels localized? The picture is from Windo...
MxRu
1

votes
1

answer
333

Views

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 StartOptions(); startOptions.Urls.Add('http://127.0.0.1:9866'); startOptions.Urls.Add('https://127.0....
aman
1

votes
0

answer
18

Views

Is it possible to use self hosted Nancy with https (ECDH-ECDSA) on Linux (Mono)?

The software I'm working on will run on an embedded system running Linux. We are currently in a hardware evaluation phase so the OS will either be Debian or a stripped-down buildroot Linux (presumably it's going to be this one). I managed to get Nancy up and running but now the requirement arose to...
Kagemusha
1

votes
1

answer
1.2k

Views

How to send html to C# SelfHost console application

Using System.Web.Http.SelfHost etc. how can I send a html page to the browser? Currently, in Google Chrome it comes through as text. I cannot find how to change the header to text/html, and I don't know whether that will fix it. I've tried a number of variations of the attached without success. The...
brianoh
1

votes
1

answer
190

Views

selfhosted WebAPI runs in IDE, but not outside of IDE

I have a selfhosted WebAPI built into a console app. When I run it via the VisualStudio IDE, everything works fine. I have a client app that connects and interacts with the WebAPI app just fine. However, if I run my WebAPI app outside of the IDE, by just double clicking the EXE, my client app is...
Wizaerd
1

votes
2

answer
778

Views

How to run XUnit test on both self-host & production webapi service?

I'd like to write a test for my ASP.NET WebApi service and run it against a self-hosted service and the live web hosted service. I imagine that this can be done with a test fixture, but I'm not sure how to set it up. Does anyone know of an example of using a configurable test fixture so that you can...
James White
1

votes
1

answer
328

Views

WPF Returing Bitmap Image to browser - Self hosted Owin Application

I am working on a Self Hosted WPF Application (using Owin) that returns bitmap images to the browser. My controller code looks like this: public ImageSource GetmbTiles(string FILE, string Z, string X, string Y) { string mbtiles = string.Format(('C:\\{0}.mbtiles'), FILE); string connString = string.F...
w2olves
1

votes
1

answer
97

Views

WCF Service Host shows 2 instances in Listening ports

I have started my WCFServiceHost, when I look into my resource monitor I see this. There are two instances of ServiceHost showing , why am I seeing this - when I only started one instance - you will notice the PID is the same . I have searched the internet and also SO ; even reading irrelevant posts...
Ken
1

votes
1

answer
542

Views

Basichttp AND net.tcp binding on a selfhosted WCF. Can't connect to net.tcp binding

I need to provide two endpoints on a self hosted WCF service. This because I am connecting to it through two different connections, one for LAN connection, one for incoming internet connections. My BasicHttp endpoint has always worked and I am now trying to add the TCP endpoint as .Net tells me I ca...
Louis van Tonder
1

votes
1

answer
827

Views

Self hosting WCF without config - Hard time understanding setting up endpoints

I've researched this for a day now and am turning to you experts here for your advice. I have REST service that is the main IIS hosted service. This service needs to interface with a 32-bit unmanaged .dll. In order to do this I'm taking one common approach which is creating a self hosted service an...
tronious
1

votes
1

answer
2.1k

Views

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 (https://github.com/Azure/azure-content/blob/master/articles/service-fabric/service...
1

votes
1

answer
206

Views

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 result as non-Admin mode. My app is trying to use...
1

votes
1

answer
177

Views

How to use Ninject to pass Initialized Instance into Web API Controller's Constructor

I am trying to use Ninject to inject dependency into a Self-host Web API Controller. I am success to inject the dependency as follows: public static IKernel CreateKernel() { var kernel = new StandardKernel(); try { kernel.Bind().To(); return kernel; } catch (Exception) { throw; } } and var server =...
user1133555
1

votes
1

answer
2.3k

Views

Owin Selfhost User Context [duplicate]

This question already has an answer here: How to pass Owin context to a Repo being injected into Api controller 3 answers I was using the regular Microsoft asp webapi 2 to create a webservice. But to get rid of the IIS-Express I switched to use the owin-selfhost-package. My only problem now is that...
Tobias Koller
0

votes
0

answer
10

Views

Owin WebAPI Max Concurrent Connections

public IHttpActionResult TestSpeed() { Sleep(10000); } Called the above API concurrently, I can only manage to squeeze approximately 16 connections within 12 seconds. I think this is kinda low. Is there any hard cap concurrent limit in Owin WebAPI Selfhost? async is not an option for now, since it r...
s k
0

votes
0

answer
7

Views

When I am try to `CreateDirectory` on mapped network drive it show me “Could not find a part of the path”

I am using System.IO. And I want create folders on mapped network drive which is mapped as Z: drive I take Array as input and try to create folder structure and I get Could not find a part of the path error `ApiResult createDirectory(List jackets) { string workingDir = @'Z:\Employe Data\Keval\Our FI...
KEVAL PANCHAL
2

votes
1

answer
1.5k

Views

WCF self-hosted service SSL/transport security/Basic authentication doesn't ask for credentials

I've created a self-hosted WCF service with HTTPS/SSL, transport security and Basic authentication. For some reason, when I run the service in the browser it never asks for credentials. What's wrong? Service configuration: HTTP config: C:\>httpcfg query ssl IP : 0.0.0.0:8555 Has...
Stefan
16

votes
5

answer
9.9k

Views

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 presents everything like I expect. But I have not...
wilee
4

votes
1

answer
664

Views

Ninject WebAPI.SelfHost Performance Issues under load (for a few seconds every few more seconds)

I'm throwing some load tests at my WebAPI Self Hosted application and have found that Ninject's Cache Pruning stalls the application for a few seconds (profiling under load in the screenshot). How can I avoid having the Cache Pruning stall requests?? All I have done is set the HttpSelfHostConfigurat...
ccook
4

votes
2

answer
1.5k

Views

SSL: NancyFx Selfhost Mono Linux (pi)

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/NancyF...
dbones
6

votes
2

answer
546

Views

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 (Microsoft.Owin.Hosting.WebApp.Start(url: baseAddress)) { Console.Read...
Clock
4

votes
1

answer
3.2k

Views

How do I get self host to work with IoC for Web-Api integration tests?

I've taken hints from here to come up with this integration test for my new Web Api project. I'm trying to build a rest web service and I have a helper client that I plan to release to API consumers. That's the ExampleClientHelper type there. Oh and btw, this all wires up to the ValuesController tha...
Matt Kocaj
2

votes
1

answer
435

Views

Servicestack self host app System.TypeloadException when using mono in ubuntu

I am attempting to run my selfhosted servicestack console app using mono in ubuntu. I am only coming up against this problem when trying to run with mono on my ubuntu server. The application works fine in a windows environment. When I try to start my app with mono appname.exe I get the following...
steve
3

votes
4

answer
2.4k

Views

Self host WCF ServiceHost object lifetime

To kick off my WCF service, I use the following: selfHost = new ServiceHost(typeof(MyServiceClass)); selfHost.Open(); At some point this will create an instance of MyServiceClass. Will it create a single instance or an instance per request?
spender
2

votes
1

answer
463

Views

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 assembly inside an Asp.Net Web/WebApi application which...
Siavash Rostami
1

votes
1

answer
66

Views

ServiceStack Razor Intellisense not working in SelfHost

I have ServiceStack.Razor referenced. Following razor file works great: @model ServiceStack.Host.Operation @Model.Name but IntelliSense (and R# code analysis) shows error: 'Cannot resolve symbol 'model'' Referencing Microsoft.AspNet.Mvc makes Intellisense work, but Razor pages are not compiled. This...
smokeing
3

votes
1

answer
1.1k

Views

OWIN compression middleware for selfhost scenario

We have an OWIN application (built with Nancy and WebAPI). When hosting it in a console application (with Katana selfhost), I don't have any compression enabled on static content. I've tried to look for a working example of OWIN GZip middleware. So far found a few like: Owin.Compression nuget, Squee...
Arie R
13

votes
2

answer
16.4k

Views

Get current owin context in self host mode

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 I...
Yaser Moradi
2

votes
2

answer
8.5k

Views

WCF Exception - The client certificate is not provided

WCF Exception - The client certificate is not provided. Specify a client certificate in ClientCredentials. After reading most of what I have been able to find on this subject, and attempting many different options, I find I don’t have any more hair to pull, and hence this post. I wish to use SSL w...
Ol_Devel
2

votes
1

answer
314

Views

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 our branding across our services to developers. Is i...
Nasseh
7

votes
3

answer
4.2k

Views

Self Hosted WebApi Accessible over LAN

Very new to the Self Host WebApi, but I am very impressed with its ease of use and extendability. At least through this tutorial. Everything I've done so far works on my development machine whether I use localhost, 127.0.0.1, or my LAN Ip (192.168.0.x) but I am baffled why I can't access the servic...
David
6

votes
1

answer
3.9k

Views

WEB API 2, Selfhost, Access is denied for everything but “localhost”

In a WEB API 2 OWIN self host project I get 'Access is denied' exception thrown for anything other then localhost in: string baseUrl = http://localhost:2500; WebApp.Start(baseUrl); If I use 127.0.0.1 or an actual IP address of the machine I get this exception. No one ever mentions this problem in th...
elector
1

votes
1

answer
1.4k

Views

Why does my Self-Hosted NancyFX application hang when running over HTTPS?

I have written a Nancy self-hosted application. This is intended to run as an API without any client interface. It is therefore a console application that is deployed via TopShelf (see code below) Everything works just fine as long as I run over standard http. However I need to secure this API by ru...
biofractal
5

votes
0

answer
286

Views

Self Hosting and IHttpHandler (ashx service)

I need to self host (in a windows process out of IIS) an existing .ashx service. The service implements an IHttpHandler.
Robert
3

votes
1

answer
1.5k

Views

Return jsonp from self hosted WEB API Console app

I've use the jsonp formatter described in this blog post: http://www.west-wind.com/weblog/posts/2012/Apr/02/Creating-a-JSONP-Formatter-for-ASPNET-Web-API Has anybody tried using the formatter with a self hosted console application? I've tried the formatter in a regular MVC 4 project, and it worked i...
Francis
2

votes
1

answer
379

Views

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) { var config = new HttpConfiguration(); config.MapHttpAt...
Dismissile
2

votes
0

answer
135

Views

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?
2

votes
1

answer
1.4k

Views

Owin Self-Host WebApi Windows Authentication and Anonymous

I have a self-hosted Owin WebAPI. I want to protect a few routes with authentication. The majority of the routes should be accessible anonymously. I have succesfully implemented Windows-Auth, but now I get 401 - Unauthorized when trying to access the routes marked with [AllowAnonymous] when accessin...
Kai
4

votes
2

answer
404

Views

Owin self host api throws exception: The format of the specified network name is invalid

I have a ASP.NET self-host web api, and I want it to listen on say http://77.176.132.62:51000. Things work just fine with http://127.0.0.1:51000, but as soon as I change it to the server's valid IP address and port, I get this exception: The format of the specified network name is invalid In this an...
Nasseh
3

votes
1

answer
534

Views

HttpListener with JWT and Basic auth: how to send WWW-Authenticate? (Self-Hosted)

I have a self-hosted REST app running cross platform on mono/.NET. The one problem is that HttpListener manages and blocks manual setting of the WWW-Authenticate header. Which is fine if you limit yourself to the built-in Basic, NTLM, etc authentication, or don't need authentication, but is a proble...
tekHedd

View additional questions