How come classes in subfolders in my App_Code folder are not being found correctly? How come classes in subfolders in my App_Code folder are not being found correctly? asp.net asp.net

How come classes in subfolders in my App_Code folder are not being found correctly?


You need to add codeSubDirectories to your compilation element in web.config

<configuration>    <system.web>      <compilation>         <codeSubDirectories>           <add directoryName="View"/>         </codeSubDirectories>      </compilation>   </system.web></configuration>


Check for BuildAction property of file. This should be set to "Compile"


Is it possible that you haven't set the folder as an application in IIS (or your web server)? If not, then the App_Code that gets used is that from the parent folder (or the next application upwards).

Ensure that the folder is marked as an application, and uses the correct version of ASP.NET.