ASP.NET MVC using App_Code directory

Ben Foster picture Ben Foster · Mar 16, 2010 · Viewed 13.1k times · Source

I've added an App_Code directory to my ASP.NET MVC project so that I get dynamic compilation for plugins.

Only slight annoyance is that when developing new plugins, I don't get intellisense on classes inside the App_Code directory.

Currently I am creating them in another directory inside my project and then copying them into App_Code.

is there any way around this?

[Update]

I've posted an "answer" below. Technically this answers the question as based on my own specification, the use of tools (i.e. intellisense) should not be required to create plugins. However, this did prompt a question of how I may achieve a dynamically compiled plugin framework without using App_Code. Since this question is so different from the original, I will raise it separately.

Answer

Jenninha picture Jenninha · Sep 18, 2012

You could try changing the files "Build Action" in Properties from "Compile" to "Content". Then they would be compiled like a WebSite. The article below explains it:

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