Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
382 views
in Technique[技术] by (71.8m points)

self hosting asp.net mvc

Is it possible to self host asp.net mvc inside another application ie. console, windows forms, service etc etc.

I'd like to build an app that offers a web interface to control it and I'd like to use asp.net mvc for the web part of it.

I did take a quick look at Nancy which looks like it would work, though its not asp.net mvc it did support razor although it doesn't have quite the same level of support for it as asp.net (eg. strongly typed views)

I did also find this question but it doesn't really go into much depth Possible to use ASPNET MVC2 without IIS?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can use "IIS 7.0 Hostable Web Core" and host the web server as part of any user process, even a console application. The benefit is that it is very similar to full blown IIS (incl config etc) but the web server itself is running in your process.

Have a look at the following articles:

  1. Host your own Web Server in your application using IIS 7.0 Hostable Web Core
  2. Creating Hosted Web Core Applications

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...