Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1201
  • Last Modified:

Visual Studio 2010 Express not finding classes in namespace via Intellisense or class view

I had a project I wanted to resurrect from years past and get moving again. I had various class files already developed in VS Express 2008 already written. I created a new .NET Web Application Project using 4.0. I copied my files into a new App_Code folder and then added them to the project via the solution explorer and didn't think anything of it. After spending some time building my site framework, I started in on the code behind of one of the pages and when I went to reference a class file, it wouldn't appear in the Intellisense. I confirmed it was the same namespace as the page I was working on and tried again, still nothing.  I checked class view and all the classes I had imported were missing, but they all had the same namespace as well.  Finally, to check my own sanity, I created a new class in the project but now even that doesn't show up in class view or Intellisense.  

These are all just straight up code *.cs files, nothing is compiled, no DLL reference and every file uses the same namespace. Am I missing a step (prayer beads? mystic? voodoo chant?) to get these properly imported and functional in my project? Should I not use the App_Code folder? I'm dead in the water!

My Solution Explorer
0
codemonkey21
Asked:
codemonkey21
1 Solution
 
Praveen KumarArchitectCommented:
Did you checked the Namespace names in your copied classes and your project? They both should be same in order to get by default. Otherwise use namespace.classname
0
 
John ClaesSenior .Net Consultant & Technical AnalistCommented:
Remember, that Web Site Project can contain App_Code folder and Web Application Project can't! Because all project is for code.
0
 
John ClaesSenior .Net Consultant & Technical AnalistCommented:
I created a new .NET Web Application Project using 4.0

Remember, that Web Site Project can contain App_Code folder and Web Application Project can't!
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
chandra_darbhaCommented:
Though I am not sure how this can happen, just check if the file properties have the right Build Action.

 Screenshot
This can be a reason why you don't get intellisense (if the Build Action is not Compile for some reason)

Thanks,
Chandra
0
 
John ClaesSenior .Net Consultant & Technical AnalistCommented:
App_Code is not used inside Web applications. This documented by Microsft.

You can try to use the "App_LocalResources" folder


app_code is only used in Web Sites.
0
 
codemonkey21Author Commented:
Setting the build property from Content to Compile worked. Changing the folder hosting the classes (App_Code) was irrelevant, I tested both with and without an App_Code folder.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now