Questions tagged [self-host]

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
65

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
3

votes
0

answer
904

Views

Web Api Owin Hosted - Throughput dropping

We've recently copied an api that we have from being IIS hosted into a console app (to be hosted with Owin + TopShelf as a service) and have been performance profiling the two hosting options using JMeter. We throw 18 threads at the apis and we get differing results back from the IIS hosted vs cons...
Tim Butterfield
3

votes
0

answer
385

Views

Bootstrap StructureMap.WebApi2 from OWIN self host WepAPI2

I have a WebAPI project that I am self hosting from an integration test suite project so that the tests will setup and tear down the WebAPI app in process, following these instructions http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api https://ovaismehboob.wordp...
Myles McDonnell
2

votes
1

answer
158

Views

servicestack restful discovery udp

in WCF, I can create a udp endpoint discovery to allow client finding the service without knowing the endpoint addresses. Is there a similar approach using restful servicestack so that the client could discovered the end point address using some kind of discovery detection ?
Turbot
2

votes
0

answer
35

Views

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 = WebApp.Start("http://localhost:8090")) { Process.Start("http://localhost:8090/api")...
user3747817
2

votes
1

answer
246

Views

Set Hostname binding and https with owin selfhosted website, WITHOUT iis

How do you bind the hostname? In short: I need this for a selfhosted website without iis: I have found how to bind the certificate, but not how to bind the hostname. netsh.exe http add sslcert ipport=0.0.0.0:82 certstorename=Root certhash=... appid={12345678-db90-4b66-8b01-88f7af2e36bf}
Emmanuel
2

votes
0

answer
557

Views

IE10 is not adding Origin Header for CORS requests to domain with same host path but different port #

This is driving me absolutely nuts. I've hacked up a basic implementation of a self-hosted WebAPI server and MVC4 client. They're in separate solutions and set to run on different ports. CORS requests were working fine in the browsers that I got around to testing (IE10/FF/Chrome) the other day, but...
Matt Caldwell
4

votes
0

answer
254

Views

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) { HttpContext.Current.AcceptWebSocketRequest(new SomeSocketHandler()); return Reques...
redb
11

votes
2

answer
4.7k

Views

Self hosting Web Api service into Windows Forms

I am trying to self host a Web Api service inside a windows forms application using the code below namespace MascoteAquarium.Desktop { static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { var config = new HttpSelfHostConfiguration("http://lo...
Andrey
3

votes
4

answer
1.1k

Views

ASP.NET 5 Self-Host

I Have a project in ASP.NET 5 using self-host. PROJECT.JSON "commands": { "web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --server.urls http://localhost:5000", "gen": "Microsoft.Framework.CodeGeneration", "ef": "EntityFramework.Commands" }, It using the http://localhos...
Felipe A.
2

votes
1

answer
402

Views

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) -> this part is ok At a later time, I want to dynamica...
Nick
1

votes
1

answer
1.3k

Views

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"; Console.WriteLine("Starting web Server..."); var server = WebApp.Start(b...
Simple Code
1

votes
1

answer
333

Views

NancyFX Self Host + SignalR + .Net Framework 4.0

Is it possible to use SignalR in NancyFx using Nancy.Hosting.Self and .Net Framework 4.0 only in a Windows Service project? I usually found solutions that uses Owin and they have to target Framework 4.5.
visualjoel
0

votes
0

answer
170

Views

SignalR selfhost server does not working

We've developed SignalR selfhost server in "c#.net as window services" and accessed by mobile application as client. We've developed with help of this link http://www.asp.net/signalr/overview/deployment/tutorial-signalr-self-host. This window services is running fine and after couple of days, mobile...
Veeramani
-4

votes
1

answer
163

Views

ServiceStack SelfHost SSL Support

i am trying to find a way to enable SSL on SelfHost ServiceStack, as this requires administrative rights today for using "Net SH", as well as the fact this is "Not Clean" as i need to maintain the Port outside of my application configuration, manage removal if port Change, etc. any help will be aw...
Roei Bar
1

votes
1

answer
583

Views

WebApi hard coded controller routing

I am trying to write a self hosted WebAPI server. I want all routes to go to a single controller. This controller can pick out the controller part of the url and use this to decide an appropriate response. I have the following route configuration: _configuration.Routes.MapHttpRoute ( name: "Default...
Prime By Design

View additional questions