zoukankan      html  css  js  c++  java
  • asp.net临时文件的重定向

    从网上搜索到下面这段文字,自己实践成功后贴出来备忘:

    Relocating Temporary ASP.NET Files

    Posted by Chris Alcock on Monday 15th October 2007 at 10:29 pm | Tagged as: .NET, ASP.NET, Development, IIS, SysAdmin

    When you first request a page from the an ASP.NET application, the .NET framework takes the ASPX file and generates code to actually execute the page. This code is then compiled by the framework and the results of the compilation are stored in the Temporary ASP.NET files directory within the framework directory (usually located in c:\windows\Microsoft.NET\Framework). When the ASPX of the compiled DLL changes this code is re-generated and recompiled.
    On a server that hosts lots of ASP.NET applications this store of temporary compiled code can occupy a considerable amount of space. On machines with a limited amount of space on their OS partition this can begin to cause problems. Thankfully the ASP.NET framework does allow the location of this directory to be specified as a custom location.
    As with most server wide settings you need to make a change to the Machine.Config (for .NET 1.1) or Machine wide web.Config (for .NET 2). The crucial part of the configuration is the Compilation element within system.web. The compilation element has an optional attribute called tempDirectory that allows a new directory location to be specified overriding the default setting of %FrameworkInstallLocation%\Temporary ASP.NET Files.

    <system.web>

       <compilation tempDirectory="d:\TempASP.NETFiles\">

          ...

       </compilation>

    </system.web>

    One thing to watch out for when making this change is the file permissions on your new Temporary ASP.NET files - copying the permissions from the original location will do the trick nicely.

  • 相关阅读:
    SQL练习题
    数据库基础
    Java-反射与注解
    Linux基础
    pipeline的使用示例
    vagrant与vrtualbox的使用
    12.04公有,私有属性,析构函数,成员属性
    12.1面向对象编程的介绍(oop):封装,继承,多态,访问私有属性
    mysql操作之二:fetchone与获取lastrowid
    10.02经典类的bug
  • 原文地址:https://www.cnblogs.com/webJingGao/p/2972812.html
Copyright © 2011-2022 走看看