开发者

Cannot deploy Aspx website, App_code folder classes become unreadable

开发者 https://www.devze.com 2022-12-16 03:13 出处:网络
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 it

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开发者_C百科 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.


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.


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.


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?

0

精彩评论

暂无评论...
验证码 换一张
取 消