6

I have created an asp.net website, with the accompanying app_code folder.

In the same solution I added a web application project, and I want to use the classes that are in the website app_code folder.

I tried adding a reference, and then adding the project (the website), but the list of project is empty... Thanks.

2 Answers 2

7

You are doing it wrong. Create a class library project and move all those classes from the app_code folder to the new project. Then reference this project from both website and web application project.

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

Comments

3

Very late, but sometimes classes in App_Code may need to stay in the same project, then

  1. Create a new folder (say "code" )in web application, and add class files from app_code as links to this folder. This lets you have a single copy.

2) Ensure Build Action for each of these imported files are "Compile" in the file property folder if need be.

3) Exclude App_Code folder from web application.

More information and reasons - please see here:

http://vishaljoshi.blogspot.in/2009/07/appcode-folder-doesnt-work-with-web.html

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.