Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't access class in App_Code 1

Status
Not open for further replies.

Peppi

Programmer
Apr 9, 2001
205
CA
Hi,

I have created a class in a given namespace. This class X is in a subfolder of App_Code. I then created another class Y in a different subfolder of App_Code. I need to import class X in class Y. However, the namespace cannot be found and I am being asked if I am missing an assembly reference. How can I import this class when dll's aren't generated for classes inside of App_Code?

Thx.
 
I suspect the issue is that you are using a web-application project rather than a web-site. Typically, the app_code folder is used in web-sites. The easiest solution is just not to use an app_code folder in a web application project, if you put your code in any other folder it will be accessible. Here is a related article on MSDN:

 
Thank you for this answer! It's helped me figure it out after two nights of banging my head against the monitor! Beautiful! I even redid my solution/project/classes three/four times over thinking it was my code but it turns out it was the Solution vs Website. Thank you.

PS I'm going to blog about this on my site too!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top