简体   繁体   English

为本地ASP.Net开发设置IIS7.5

[英]Setting up IIS7.5 for local ASP.Net Development

Are there any particular settings one should optimally enable/disable/tweak when doing ASP.Net MVC development on local test machine Windows 7 using IIS 7.5 and moving in and out the debugger & recompiling refrequnetly (integration/troubleshooting stage now before TDD fantactics throw stones - although admittedly I could have more under test), I work with 64 bit edition but figure this probably applicable at both x86/x64? 在使用IIS 7.5在本地测试机Windows 7上进行ASP.Net MVC开发并进行调试器的调试和重新编译时,是否有任何特定的设置可以最佳地启用/禁用/调整(现在是集成/故障排除阶段,之前是TDD幻想之作) -尽管我可以接受更多测试),但我使用的是64位版本,但想知道这可能同时适用于x86 / x64吗?

I'll start with one: Ping Period (seconds) - increase from 90 to 3000 (or something somewhat higher) so you can if unfortunately need to a good bit of time whilst debugging or disable ping on local test machine. 我将从一个开始:Ping周期(秒)-从90增加到3000(或更高一些),因此不幸的是,您可以在调试或禁用本地测试机上的ping时花费大量时间。

Credit: http://blogs.msdn.com/johan/archive/2007/09/12/my-web-application-times-out-when-debugging-in-iis7.aspx 图片来源: http//blogs.msdn.com/johan/archive/2007/09/12/my-web-application-times-out-when-debugging-in-iis7.aspx

However I see over stuff such as: Disable Overlapped Recycle & Recycling settings etc.. that I wonder if could increase performance or make debugging less friction 但是我看到了诸如“禁用重叠的回收和回收设置”之类的东西。我不知道这是否可以提高性能或减少调试的麻烦

Question prompted by the annoyance that I've ran across a few recent debugging issues (not apparent in production) including a random, and tempormental error "An assembly with the same simple name blah-blah-lah-assembly-definiton has already been imported . Try removing one of the references or sign them to enable side-by-side." 烦恼引起的问题是我遇到了一些最近的调试问题(在生产中不明显),包括一个随机的暂时性错误“已经导入了一个具有相同简单名称blah-blah-lah-assembly-definiton的程序集 。尝试删除其中一个参考或对其进行签名以启用并排。” (iisreset resovles) and generally slow debugging attaching. (iisreset resovles),通常会减慢调试过程。 The points and answers to this question need not help with the above (I believe it may be related to spark view engine as that where the stacktrace ends) but figure it worth mentioning incase someone has a direct suggestion * 这个问题的要点和答案在上述方面无济于事(我认为它可能与spark视图引擎有关,因为stacktrace结束于此),但是如果有人提出直接建议,则值得一提*

quick tip: if you're experiencing slow response times (~1-1.5 sec) from browsers other than internet explorer (eg: firefox, chrome, safari) while running your mvc/ other web app on your local machine using win7/vista, it is due to dns resolution with ipv6. 快速提示:如果您在使用Win7 / Vista在本地计算机上运行MVC /其他Web应用程序时,如果浏览器不是Internet Explorer(例如firefox,chrome,safari)浏览器,则响应时间较慢(〜1-1.5秒),这是由于ipv6的DNS解析。

firefox solution : disable ipv6 in about:config (boolean cfg 'network.dns.disableIPv6') firefox解决方案 :在about:config中禁用ipv6(布尔cfg'network.dns.disableIPv6')

machine wide soft solution : uncomment the good old localhost address in the hosts file (%WINDIR%\\System32\\drivers\\etc\\hosts): 机器范围内的软解决方案 :取消注释主机文件(%WINDIR%\\ System32 \\ drivers \\ etc \\ hosts)中的旧主机名:

# localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost
#   ::1             localhost

machine wide hard solution : disable ipv6 completely 机器范围内的硬解决方案 :完全禁用ipv6

credit goes to this blogpost: http://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slowness-with-localhost-on-vista.aspx 鸣谢此博客文章: http ://weblogs.asp.net/dwahlin/archive/2007/06/17/fixing-firefox-slowness-with-localhost-on-vista.aspx

Embarcadero guys just published a fresh article on similar topic for Delphi Prism (aka Delphi for .NET), so why not take a look on their suggestions? Embarcadero的家伙们刚刚发表了一篇关于Delphi Prism(又名.NET的Delphi)的类似主题的新文章,那么为什么不看看他们的建议呢?

http://edn.embarcadero.com/article/40108 http://edn.embarcadero.com/article/40108

From the experience i have working with asp.net mvc, i can tell that there are no special settings for IIS 7 or IIS 7.5 for working on asp.net mvc projects. 从我使用过asp.net mvc的经验来看,我可以知道在asp.net mvc项目上没有IIS 7或IIS 7.5的特殊设置。 It works fine in the default form, you just need to create a new website and point it to the folder that has the files for you application. 它在默认格式下可以正常工作,您只需要创建一个新网站并将其指向包含您的应用程序文件的文件夹即可。

For debugger if you ask, you can simply put a breakpoint in the code and hit that breakpoint when you run the application from visual studio. 对于调试器,如果您提出要求,您可以简单地在代码中放置一个断点,然后在从Visual Studio运行应用程序时点击该断点。 But by default the application will use the development web server that fires up when you run a web application from visual studio. 但是默认情况下,应用程序将使用从Visual Studio运行Web应用程序时启动的开发Web服务器。 If you want to the application to run using the IIS installed on your system you will have to change the project settings. 如果要使应用程序使用系统上安装的IIS运行,则必须更改项目设置。 See here for a screen shot of how to do so 有关如何操作的屏幕截图,请参见此处

http://blogs.bootcampedu.com/blog/post/Debugging-aspnet-mvc-application-using-IIS.aspx http://blogs.bootcampedu.com/blog/post/Debugging-aspnet-mvc-application-using-IIS.aspx

Additionally you can also use System.Diagnostics.Debugger.Break(); 另外,您还可以使用System.Diagnostics.Debugger.Break();。 for putting a break point in the code. 在代码中放置一个断点。

If you only want to debug your application, I recommend to use the built-in development server of Visual Studio. 如果只想调试应用程序,建议使用Visual Studio的内置开发服务器。 If you debugged the most of it or want to do that on IIS, I recommend you the Ctrl+Alt+P shortcut, which enables you to attach a debugger. 如果您最多调试了该调试器,或者想在IIS上进行调试,则建议您使用Ctrl + Alt + P快捷键,该快捷键使您可以附加调试器。 Select w3wp.exe and you can debug with IIS. 选择w3wp.exe,然后可以使用IIS进行调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM