Open icnocop opened 6 years ago
Can you tell me the versions you are using, and which host (direct or socket)? There are some issues with weird assumptions made by the underlying ASPNet libraries (like basing the memory model on the exe name). I thought I got them in the recent revisions (this commit https://github.com/i-e-b/Huygens/commit/1bf4737cf17fca252f2b47fe2a969b512fd007df)
I'm using Hyugens 1.4.5 and SocketServer
.
[TestMethod]
public void Huygens()
{
using (var server = new SocketServer(32768, "/", projectPath))
{
server.Start();
while (keepRunning)
{
Thread.Sleep(1000);
}
server.ShutDown();
}
}
Thank you.
I've attached a sample project that can be used to reproduce the issue here: WebApplication5.zip
The web application was created using Visual Studio 2015 Update 3: File > New Project > Templates > Visual C# > Web > .NET Framework 4.5.2 > ASP.NET Web Application (.NET Framework) > MVC + Web API.
Steps to reproduce:
projectPath
variable to the output path of the WebApplication5
project.Huygens
test.http://localhost:32768
.Thank you!
Thanks for that. I'll have a look as soon as I can.
There's a test in C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.Web.dll
in the Headers
property that is testing for the worker request to be an exact internal type. I might be able to trick it, or change something further up the stack... but I'm not sure.
From what I can see, Microsoft have forced you to pick either IIS integration or 'real' OWIN with self-hosting, but not have both.
You might be able to use the OwinHost
package ( as described at https://docs.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/an-overview-of-project-katana ) and run the socket listener inside another process.
It might be possible to extend Huygens with something like https://github.com/aspnet/AspNetKatana/blob/dev/src/OwinHost/Program.cs#L87 But I don't have the time to do that right now, sorry.
Thank you for doing research to find out the underlying issue.
I tried using the OwinHost v4.0.0.0 NuGet package and run OwinHost.exe, but that only runs the code in Startup.cs and so doesn't serve MVC pages, only Web API services.
From what I've read, the only way to self host MVC + OWIN is to use ASP.NET Core.
The other options I've found:
OwinStartup
and just use Application_Start
instead.
To get an instance of HttpConfiguration
, use GlobalConfiguration.Configure
.OwinStartup
with WebActivatorEx.PreApplicationStartMethod
using WebActivator.But in either case, IAppBuilder
cannot be used.
Hi.
Thank you for Huygens.
I tried hosting my ASP.NET MVC 5 web application using Huygens but I received the following error:
I can host my web application in IIS without issues.
Will implementing "Add OWIN rq/tx to the compatibility classes" in your "To do" list resolve this issue?
Thank you!