self-hosting

Using WebAPI in LINQPad?

本小妞迷上赌 提交于 2019-12-20 09:21:42
问题 When I tried to use the Selfhosted WebAPI in LINQPad, I just kept getting the same error that a controller for the class didn't exist. Do I have to create separate assemblies for the WebAPI (Controllers/Classes) and then reference them in my query? Here's the code I'm using #region namespaces using AttributeRouting; using AttributeRouting.Web.Http; using AttributeRouting.Web.Http.SelfHost; using System.Web.Http.SelfHost; using System.Web.Http.Routing; using System.Web.Http; #endregion public

ASP.NET Web API Self-Host with Windows Authentication

戏子无情 提交于 2019-12-20 08:43:04
问题 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 System.Web.Http; using System.Web.Http.SelfHost; namespace SelfHost { class Program { static void Main(string[] args) { var config = new HttpSelfHostConfiguration("http://myComputerName:8080"); config.UseWindowsAuthentication = true; config.Routes

ASP.NET Web API Self-Host with Windows Authentication

倖福魔咒の 提交于 2019-12-20 08:42:01
问题 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 System.Web.Http; using System.Web.Http.SelfHost; namespace SelfHost { class Program { static void Main(string[] args) { var config = new HttpSelfHostConfiguration("http://myComputerName:8080"); config.UseWindowsAuthentication = true; config.Routes

Self hosted OWIN and urlacl

人走茶凉 提交于 2019-12-17 07:26:11
问题 I've created a self hosted Nancy/SignalR application self-hosted in OWIN using Microsoft.Owin.Host.HttpListener and Microsoft.Owin.Hosting Things work perfectly fine locally but as soon as I try to use anything but localhost to access the app I get a HTTP Error 503. The service is unavailable error. I can't even access the app using 127.0.0.1 or the machine name. I've tried adding the port to urlacl using http add urlacl http://*:8989/ user=EVERYONE but doesn't seem to do anything. here are

Owin Selfhosting return data in streamed mode

依然范特西╮ 提交于 2019-12-13 18:31:47
问题 I'm selfhosting a service. I'm able to HttpGet and HttPut objects. Now I need to return a large File(stream). My question is how to return a large stream. Below I write the methods I use to get and save a test class Customer. Possible duplicates: Selfhosting deal with large files. Alas the answer doesn't help me, it states: make sure that the response content is a StreamContent . Until now I didn't need to write any response content. What should I change to return a StreamContent ? ASP.NET

Unable to access a self-hosted WCF service on azure virtual machine

十年热恋 提交于 2019-12-13 04:44:20
问题 I have self-hosted a WCF service on base adress new Uri("http://" + Environment.MachineName + ":1235/myService") on an Azure Virtual Machine. I have printed this address and I get it as http://TRIALVM:1235/IRChatbotService . The DNS name of my virtual machine is trialvm.cloudapp.net . As I have hosted this service on port 1235, I have added the inbound rule with following properties: Still the created service is not accessible from outside VM. I am able to get service page when I go to the

Self hosting Web API with OWIN on EC2

心不动则不痛 提交于 2019-12-13 04:42:05
问题 I followed step-by-step instructions from http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api. Here is the code of console application: namespace OWINTest { class Program { static void Main(string[] args) { string baseAddress = "http://localhost:1961/"; // Start OWIN host WebApp.Start<Startup>(url: baseAddress); ... } } class Startup { // This code configures Web API. The Startup class is specified as a type // parameter in the WebApp.Start method. public

Sessions in self-hosted WCF services

你说的曾经没有我的故事 提交于 2019-12-13 03:18:49
问题 prompt please how can I use session in self hosted WCF? I need to implement ASP.NET like sessions (client identification and possibly data sharing). Is there any native way to do so in WCF or I have to implement this behavior manually (sending some unique value with each request and storing them in some sessionID store)? Thanks in advance. P.S. Sorry for poor English. 回答1: You can have sessions in self-hosted WCF, but you'll need to use a binding which has session support. WSHttpBinding,

Is there a way to add an httpModule when webApi is running with the HttpSelfHostServer?

為{幸葍}努か 提交于 2019-12-12 16:19:07
问题 I have a MVC4 webapi controller. It has no parameter-less constructors. So, i use Windsor dependency resolver and everything is fine when work under System.Web.Http.WebHost. But, when I try to use HttpSelfHostServer, i get the exception message: Looks like you forgot to register the http module Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule To fix this add <add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor" /> to the

Return jsonp from self hosted WEB API Console app

扶醉桌前 提交于 2019-12-12 09:55:18
问题 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 immediately. However, I would like to use it in a self hosted console application, and I've had a lot of trouble getting it to work. I've registered the formatter, and verified that it is added: var