self hosting asp.net mvc

前端 未结 3 382
灰色年华
灰色年华 2020-11-28 06:22

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

相关标签:
3条回答
  • 2020-11-28 07:19

    I know this question is old, but it is still relevant, so with the .NET Core 1.0 + ASP.NET MVC 6 you can self-host your MVC application easily. You can even combine MVC and WebAPI applications into one, and you can decide later if you want to use IIS, IIS Express or the self-hosting feature of the .NET Core.

    You can try it if you follow the Yeoman approach from this post: https://stackoverflow.com/a/30314393/980247

    0 讨论(0)
  • 2020-11-28 07:20

    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
    0 讨论(0)
  • 2020-11-28 07:20

    Please have a look at http://cassinidev.codeplex.com/ It has many advantages for example

    • No need IIS 7 on client machine
    • Support MVC (I have tested myself)
    • Work well with Windows Form and Web Browser Control for packaging as Windows App
    • Cross Win OS platform ( Windows XP, Vista, 7) I have test XP with .NET 4 installed

    Hope this helps.

    0 讨论(0)
提交回复
热议问题