ASP.NET MVC on Cassini: How can I force the “content” directory to return 304s instead of 200s?

前端 未结 3 2011
北海茫月
北海茫月 2020-12-14 11:27

Scenario: I have an ASP.NET MVC application developed in Visual Studio 2008. There is a root folder named \"Content\" that stores images and stylesheets. Wh

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 11:49

    Another option for you is to simply skip Cassini and debug under IIS. It's pretty straightforward, and won't take you ten minutes to get up and running. Browse 20 of your pages on Cassini, and you've used that time anyway ;)

    One thing I've noticed isn't always in the guides, is that if you want to debug on a different address than http://localhost/ you need to manually set the host to your local IIS. This is done by adding a line in the hosts file, located at

    C:\Windows\system32\drivers\etc\hosts

    Open the file with notepad (you need to "Run as Administrator" in order to be able to save if you're using Windows Vista and have User Account Control turned on...) and add your host. For example, to debug under http://mysite/ you add

    mysite         127.0.0.1
    

提交回复
热议问题