C# – Cannot deploy Aspx website, App_code folder classes become unreadable

asp.netcdeploymentweb

I have recently finished creating my website, I have therefore come to the stage where I have to deploy it to a live server however when copying across, all of the App_Code, App_Data and Bin folder items become unaccessible. All of the classes are fine when I run on my dev server but once the files go across (exactly as they are) I can no longer create instances of objects from the App_code folder (very important).

The error I get is a quite generic error message.

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

I have never needed to declare a namespace for the code in App_Code before so I presume the error is not completely accurate. The permissions on files and folders are also the same.

When I use intelisense on the deployed website, it does recognise the objects. However once Comiled are not usable.

Any help would be much appreciated.

Best Answer

Do you have a missing refrence when you move to the new server?

Check your project's refrence folder and project settings. Make sure the .dlls are marked copy local and if your using anything from the GAC. If so you may need to deploy the .dll to the production server for things to work.