Search code examples
vb.netvisual-studio-2013app-code

User Control inside App Code Folder throws Errors


I'm currently trying to debug an existing project. After fixing some dll reference all seems to run well except we got an error:

The File '/App_Code/UserControl.ascx' is in the special directory 'App Code', which is not allowed.

The error is pointing at this line:

<%@ Register TagPrefix="uc" TagName="UC" Src="../App_Code/UserControl.ascx" %>

I did some research and found out that your not suppose to put controls in App Code folder but this somehow work for them so far.

Changing the location of the file generates more errors.

Can anyone please suggest options in fixing this?


Solution

  • You'll probably just have to dig through all the errors caused by moving it, manually fixing up references. Maintenance programming is a dirty job, but somebody's got to do it. That, or (as turned out to be useful) rename the folder to something else and fix any remaining errors.