self-hosting

WebApi with OWIN SelfHost and Windows Authentication

谁都会走 提交于 2019-11-28 10:26:30
I have a console application SERVER that hosts WebApi controllers using OWIN self-hosting, and runs under a custom account named "ServiceTest1". In the same machine I have another console application CLIENT that runs under the account "ServiceTest2", and I want to capture in SERVER that "ServiceTest2" invoked a controller action. However: WindowsIdentity.GetCurrent() is always "ServiceTest1". Thread.CurrentPrincipal is an unauthenticated GenericIdentity . RequestContext.Principal is null. User is null. What do I need to make this WebApi OWIN self-hosted to grab the Windows identity of the

Can WCF RIA Services be self hosted?

笑着哭i 提交于 2019-11-28 08:23:07
问题 I know WCF can be self hosted. how about WCF RIA Services? Thanks! 回答1: Actually, it can be self-hosted after small configuration: DomainServiceHost host = new DomainServiceHost(typeof(DomainService1), uri); host.Description.Behaviors.Remove<AspNetCompatibilityRequirementsAttribute>(); 回答2: WCF RIA Services is build on top of WCF and they get exposed as WCF services. See WCF RIA Services on MSDN. 回答3: According to this forum thread on MSDN, it is not possible to do such thing because RIA

WCF Self Host Service - Endpoints in C#

巧了我就是萌 提交于 2019-11-28 00:29:58
问题 My first few attempts at creating a self hosted service. Trying to make something up which will accept a query string and return some text but have have a few issues: All the documentation talks about endpoints being created automatically for each base address if they are not found in a config file. This doesn't seem to be the case for me, I get the "Service has zero application endpoints..." exception. Manually specifying a base endpoint as below seems to resolve this: using System; using

SelfHosted AspNet WebAPI With Controller Classes In Different Project

陌路散爱 提交于 2019-11-27 23:48:56
问题 I have created a SelfHosted AspNet WebAPI with Visual Studio 2012 (.NET Framework 4.5). I enabled SSL for the WebAPI. It works fine when the controller is defined in the same project. But when I add a reference of another project, containing controllers, it gives me the following error: No HTTP resource was found that matches the request URI 'https://xxx.xxx.xxx.xxx:xxxx/hellowebapi/tests/'. I have created custom classes for HttpSelfHostConfiguration and MessageHandler. Any help to resolve

How to get gzip compression working in WCF 4.5

╄→гoц情女王★ 提交于 2019-11-27 20:36:13
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 to use IIS; i can't switch to any WCF replacement. this works with gzip: binding="customBinding" bindingConfiguration="tcpCompressionBinding" name="tcp" and this is what i currently use for http: binding="basicHttpBinding" bindingConfiguration="httpBinding" name="http" The documentation does not really help me: http://msdn.microsoft.com/en-us

Can I automatically host all services in app.config when using SelfHosting?

こ雲淡風輕ζ 提交于 2019-11-27 16:38:04
问题 I'm writing an application which needs to host several WCF services. One of the strengths of WCF is the ability to configure services without having to recompile, by specifying settings in the app.config file. When self-hosting, there does not appear to be an out-of-the-box way to automatically host services which are in the app.config file. I found this question which mentions a possible solution of dynamically enumerating services listed in app.config at runtime, and creating a ServiceHost

Resolving HttpControllerContext with Castle Windsor

雨燕双飞 提交于 2019-11-27 13:30:33
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 inject that information into the service. This is pretty easy to do using Poor Man's DI: just implement a custom IHttpControllerActivator . However, with Castle Windsor this suddenly becomes very difficult. Previously, I've described a very convoluted way to resolve this issue, but it hinges on the PerWebRequest lifestyle, and it turns out that this

Self-host of ASP.NET MVC application

廉价感情. 提交于 2019-11-27 10:55:38
问题 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 hosts it (self hosting). I tried with Microsoft.Owin.Host.HttpListener and Nancy.Owin but while I get 404 pages my configurations lacks the mapping to my MVC-app. I got public class Startup { public void Configuration(IAppBuilder app) { app.UseNancy(

HttpSelfHostServer and HttpContext.Current

冷暖自知 提交于 2019-11-27 07:28:21
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 HttpSelfHostServer don't work with the static HttpContext-Class. The thing I don't understand is: why..? And I can't figure out a way to tell neither HtttpSelfHostServer nor HttpSelfHostConfiguration to work with HttpContext . Here's what I'm doing: Creating a HttpSelfHostConfiguration 1.1 Adding Service-Resolvers & Routes 1.2 Adding custom UserNamePassword

Which build of Cassini should I choose for production? There are 8 public builds from 5 different authors

ぐ巨炮叔叔 提交于 2019-11-27 07:03:59
问题 I found several versions of an IIS-free Cassini webserver built by Microsoft. I'd use it but I'm unsure of which one is best, since there are many forks/builds: the original dmitryr's v3 (with corresponding bug), v3.5, and v3.5.1, A VB-based fork by MPosseth Cassini++ Based on one of dmitryr's builds Cassini Dev by Sky Another version by zippy1981 UtiDev Cassini (not a direct Cassini port/fork but close enough) Hostable Web Core What web server do you recommend of the forks above; is Hostable