Closed icnocop closed 5 years ago
From what I've read, the only way to host MVC + OWIN outside of IIS 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 @icnocop, I think you need to use Owin to host asp.net mvc 5. Not 100% sure about the details, it needs a little bit of digging and trial and error. Maybe @mikdav can shed some light on this and might be able to help since they implemented the owin support. There is also an example on the readme that might be of help.
Correct. The default MVC template assumes an IIS or IISExpress host and adds a bunch of things that are dependent on that host. If you only need WebAPI, you can go the OWIN host route, which is already implemented. This is what I implemented because we only use WebAPI at my company--not the rest of MVC.
If you need the rest of MVC (view rendering, etc), you will need to move to ASP.NET Core. I have not tested it, but ASP.NET Core can supposedly run on top of an OWIN compatible host, so it should work with what has already been built into sharpfastcgi.
Since there have been no further comments, I'm closing this.
I tried hosting my ASP.NET MVC 5 web application but I received the following error:
I can host my web application in IIS without issues.
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 > Checkmark Web API. WebApplication7.zip
Steps to reproduce:
Open solution in Visual Studio 2015.
Build solution (Debug|Any CPU).
Copy the following files to the root of the web application and also in bin: Grillisoft.FastCgi.AspNet.dll Grillisoft.FastCgi.dll Grillisoft.FastCgi.Loggers.Log4Net.dll Grillisoft.ImmutableArray.dll log4net.config log4net.dll
Run
.\Examples\windows-nginx-1.6.2\nginx.exe
Update
.\FastCgi.Server\bin\Debug\Grillisoft.FastCgi.Server.exe.config
and set thePhysicalPath
value to the full path of the web application root.Run
.\FastCgi.Server\bin\Debug\Grillisoft.FastCgi.Server.exe
Browse to http://localhost:8082/index.aspx.
Notice the error:
Any ideas?
Thank you.