iis-7 – localhost上的IIS非常慢

前端之家收集整理的这篇文章主要介绍了iis-7 – localhost上的IIS非常慢前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在 Windows Vista双核cpu上使用IIS7.第一次点击WCF服务或ASP.NET网页表有时会花费超过一分钟,这对我来说是不可接受的.

我将应用程序配置为使用Classic .NET应用程序池并尝试使用Maximum worker进程,首先将其设置为4,但将其重新设置为1,因为它没有预期的结果.还有其他我可以试试的东西吗?

解决方法

检查web.config文件获取编译模式.在开发过程中,您应该以调试模式运行站点.如果您在发布模式下运行,则每个aspx和ascx都将编译为临时程序集,而不仅仅是您点击的页面和控件.另外,将batch设置为false.
<configuration>
    <system.web>
         <compilation debug="true" batch="false" ...>
         ...
         </compilation>
    ...
    </system.web>
    ...

当然,这些不建议用于生产环境,这些环境会因这些变化而变慢.

另外,检查this forum thread,您可以在其中找到一些有趣的提示,例如重置ASP.NET临时文件文件夹的权限:

I had the same problem and made all of
the adjustments as mentioned in this
forum but it didn’t help. I began to
suspect that the slow loading time of
the dlls had to do with security
settings. It appears that access to
the dlls goes through security
checking that is part of the operating
system and not part of VIsual Studio.
The dlls are located in a directory
for your application under:

06001

In order to speed up the security
checking,you need to remove all of
the security settings on the root
folder of your application in the
above mentioned directory,or on the
directory “Temporary ASP.NET Files” if
you want to have it apply to all web
applications you develop.

You right mouse click the folder and
select Properties -> Security

Remove all users and groups. Some will
not be allowed to be removed because
they inherit their permissions from
their parent folder. You must first
remove the inheritance by clicking on
the Advanced button and then uncheck
the “Inherit from parent…” checkBox.
Then remove the user or group. There
must not be any users or groups where
the checkBoxes for their permissions
are greyed out. If they are greyed
out,it means that you didn’t remove
the inheritance from their parent.

After you have removed all users and
groups from the folder,you then need
to add the following users and groups:

Administrators Users ASPNET Network
Network Service Local Service

Give each of these accounts full permission. Click on the Advanced button again and check off the “Replace permission entries on all child objects…”

猜你在找的asp.Net相关文章