1

When I launch the website locally it works fine, however when I upload this to the server I get "The type or namespace name 'type/namespace' could not be found.." for my App_Code folder

my ".aspx.cs" class

using XXXXXX.App_Code;

Any clues as to why?

6
  • Are you uploading all of the proper binaries? Commented Apr 3, 2013 at 14:17
  • The rest of the error message is "are you missing a using directive or an assembly reference?" The using directive is obviously there. Are you missing an assembly reference? Commented Apr 3, 2013 at 14:17
  • yes I'm aware, but it compiles correctly and works locally Commented Apr 3, 2013 at 14:19
  • try changing the .net version to 4.0.in project setting. Commented Apr 3, 2013 at 14:20
  • @dtb what assembly reference would I be missing? Commented Apr 3, 2013 at 14:22

3 Answers 3

6

You want to change whatever inside App_Code folder to Compile.

enter image description here

Sign up to request clarification or add additional context in comments.

7 Comments

I don't have this option, I only have, File Name, Custom Tool and full path name
Please make sure you click on a Class. If still doesn't work, please post a screenshot of Solution Explorer (expend all items).
Is there a reason not to use ASP.Net Web Forms Application under File > New > Project > Templates > Visual C# > Web > ASP.Net Web Forms Application?
Not really, I imported an existing website, visual studio chose the "website" type for me
You are using Web Site Projects. Here is the differences - msdn.microsoft.com/en-us/library/dd547590.aspx
|
1

You may be uploading to the server which doesn't have the correct version of .NET or the correct framework. I've had this issue updating my MVC3 website to a server which doesn't have MVC3 installed.

Make sure the Application Pool in IIS is referencing the correct version and that the server has the relevant framework(s) installed.

Also, in Visual Studio, under Items to deploy, make sure All files in this project folder are selected and that Exclude files from the App_Data folder is not checked.


If you built your site as a project (ie, not a website)

Right click on the Solution -> Configuration Manager and check that it exists for Release and is checked to Build


If you built your website as a new website (ie, not via new project)

Right click on the solution and select Property Pages. Make sure the file is added under References. Make sure under Build, Build website before running is selected

1 Comment

@MikeBryant OK, sorry for confusing you. Within your website, right click on Solution and selection and select Property Pages. Make sure, under references, your file is there. And check that the website is set to build before running (under build)
0

Create a \bin folder under your website and copy dlls you reference there.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.