BuildProvider must be compiled into a different assembly than the other code in the App_Code folder : BuildProvider « Development « ASP.NET Tutorial






You must add a BuildProvider to a separate subfolder because a BuildProvider must be compiled into a different assembly than the other code in the App_Code folder. 

Define the CustomBuildProviders folder and registers the SimpleBuildProvider.
Whenever you add a file with the .simple extension to the App_Code folder, the SimpleBuildProvider automatically compiles a new class based on the file.

File: Web.Config

<configuration>
    <system.web>
      <compilation>
        <codeSubDirectories>
          <add directoryName="CustomBuildProviders"/>
        </codeSubDirectories>
        <buildProviders>
          <add extension=".simple" type="MyNamespace.SimpleBuildProvider" />
        </buildProviders>
       </compilation>

    </system.web>
</configuration>








9.5.BuildProvider
9.5.1.Creating a Custom BuildProvider
9.5.2.BuildProvider must be compiled into a different assembly than the other code in the App_Code folder