设为首页 收藏本站
查看: 901|回复: 0

[经验分享] Using IIS Express as ASP.NET Development Server

[复制链接]

尚未签到

发表于 2015-8-13 11:10:13 | 显示全部楼层 |阅读模式
  As we all know, ASP.NET MVC 3 was released several days ago, which is really exciting event to all geeks. In the new release, there are not tons of improvements and new components including CodeFirst, Razor, IIS Express, NuPack, SQL CE 4, you name it.
  However, there is also a fact in front of us. How many new features can we use in old-fashioned existed ASP.NET projects? I have no idea. But I can tell you that we can utilise IIS Express Server to replace ASP.NET Development Server or IIS Web Server without breaking our code in place.
  I know, now, you may have two questions.


  • Why should we bother to use IIS Express?
  • How can I use IIS Express in development?
  Well, let’s me answer them one by one.

Why
  First concern, actually the benefits through using IIS Express. To answer that, I would like to quote the words from Scott Gu’s post.

  ASP.NET Development Server
  The downside with the ASP.NET Developer Server, though, is that it does not support a full set of web-server features.  For example, it doesn’t support SSL, URL Rewriting Rules (like the SEO URL Rewrite Rules I blogged about here), Custom Security Settings, and other richer features now offered with IIS 7.
  IIS Web Server
  The downside with using the IIS option today, though, is that some companies don’t allow full web-servers to be installed on developer machines. IIS also requires administrator account access to setup and debug projects.  Different versions of Windows also support different versions of IIS.  For example, if you are running on Windows XP you have to use the IIS 5.1 web-server that comes with it – which doesn’t support all the new features of IIS 7.x.  Configuring a web project within VS to use IIS also requires some extra installation and configuration steps.

IIS Express – The Best of Both Options
  We have been working on a new flavor of IIS 7.x that is optimized for developer scenarios that we are calling “IIS Express”. We think it combines the ease of use of the ASP.NET Web Server with the full power of IIS.  Specifically:


  • It’s lightweight and easy to install (less than 10Mb download and a super quick install)
  • It does not require an administrator account to run/debug applications from Visual Studio
  • It enables a full web-server feature set – including SSL, URL Rewrite, Media Support, and all other IIS 7.x modules
  • It supports and enables the same extensibility model and web.config file settings that IIS 7.x support
  • It can be installed side-by-side with the full IIS web server as well as the ASP.NET Development Server (they do not conflict at all)
  • It works on Windows XP and higher operating systems – giving you a full IIS 7.x developer feature-set on all OS platforms
  IIS Express (like the ASP.NET Development Server) can be quickly launched to run a site from a directory on disk.  It does not require any registration/configuration steps. This makes it really easy to launch and run for development scenarios.

  As most developers are constructing enterprise applications, in this scenario,   

How
  IIS Express is integrated with Visual Studio 2010 SP1, which is still in beta version. If you don’t like to install SP1 beta, you can’t find a place to enable IIS Express in any form of configuration. However, we still can use it as our development web server by a little bit DIY. Well, are you ready? Let’s roll.
  Firstly, be sure you have installed IIS Express. If not, you can install it through Web Platform Installer (ASP.NET MVC3 doesn’t install IIS Express, WebMatrix does). Launch IIS Express to check whether it works.
DSC0000.png
  Once the IIS Express is launched, you will see an tray icon shown like below.
DSC0001.png
  
  Then, terminate IIS Express Server and open the config file, C:\Program Files\IIS Express\config\templates\PersonalWebServer\applicationhost.config

        <sites>
<site name="WebSite1" id="1" serverAutoStart="true">
<application path="/">
<virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
</application>
...
</site>
...
</sites>
  Change the physicalPath to your web site path, say C:\Users\misaxi\Documents\Visual Studio 2010\WebSites\Umbraco, and run IIS Express Server again.
  
  Finally, open the property page of your web project. In Web tab, Choose the option Use Custom Web Server and input the server url.
DSC0002.png
  
  Well, there you go. You can use IIS Express as your dev server now. ;p

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-98400-1-1.html 上篇帖子: flv mime IIS设置 下篇帖子: IIS配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表