Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am getting the following error when I put class files in subfolders of my App_Code folder:

errorCS0246: The type or namespace name 'MyClassName' could not be found (are you missing a using directive or an assembly reference?)

This class is not in a namespace at all. Any ideas?

like image 728
Greg Avatar asked Sep 30 '08 21:09

Greg


1 Answers

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>
like image 161
AnthonyWJones Avatar answered Oct 31 '22 12:10

AnthonyWJones