views:

258

answers:

3

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.

A: 

Are you manually copying the site's files (say, with an FTP client) or are you using the Copy Website tool ('Website' menu, `Copy Website...' menu item)? I'd hope the tool can help you get all the necessary files copied over neatly.

The error message you are seeing doesn't necessarily require namespaces; it's referring to a type with no namespace, or in one of the namespaces in your 'using' statements, called 'Display,' that you've referred to in one of your ASPX files. That;s pesumably one you've put in your App_Code folder. Don't worry about using namespaces.

Steve Cooper
+3  A: 

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.

Tj Kellie
A: 

I am using the VS2008 Copy Website function to deploy the website. I have not needed to have a using declaration before to access the app code I presumed it was always accessible from anywhere within the website.

How do I check the dll which you mentioned?

think1712