Aug 14
VN:F [1.6.7_924]
Rating: 0.0/7 (0 votes cast)

Points to remember about APP_CODE Directory

  • Asp.net handles the files in bin and app_code folder in a special way.
  • The compiled classes (dll) placed in bin folder are automatically available to all the pages in application. We don’t need to register the assemblies to use them. Asp.net automatically detects the new version of assembly and start using the new one.
  • Assemblies in the bin folder have application scope. They cannot access the resources outside the current web application.
  • The access levels of assemblies are determined by the trust level specified by the local computer.
  • By default code run in full trust under visual studio development environment.
  • We can store and create as many folder and files (class files) in app_code folder. But Asp.net still compile all in a single assembly.
  • As Asp.net compiles all the code (App_code) in a single assembly, all files must be of same programming language. Ex – App_Code folder cannot contain code in both VB.Net and C#. However we can make settings in web.config to configure the code subdirectories in different compliable units. The configuration is specified by creating a “codeSubDirectories” element in the compilation element of the Web.config file. Ex –

<compilation debug=”false”>
    <codeSubDirectories>
        <add directoryName=”VBCode” />
        <add directoryName=”CSCode” />
    </codeSubDirectories>
</compilation>

Tagged with:
preload preload preload