• 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.

  • 相关阅读:
    怎么做程序?(摘录微博)
    ObjectiveC protocol & delegate
    iPhone网络编程之监视网络连接
    第二个iPhone应用程序:“Say Hello”
    NSNotificationCenter 的使用详解
    打字效果,自动换行的CCLabelTTF
    objectc's selector (forward)
    IOS触摸事件
    如何使用Android SDK Manager下载 SDK
    年月日三级级联
  • 原文地址:https://www.cnblogs.com/webJingGao/p/2972812.html
Copyright © 2020-2023  润新知