Kirk Evans Blog

.NET From a Markup Perspective

Reference component in app_code

There are situations when you need to refer to a component that is located in the app_code directory by using the type and assembly portions of the 5-part name (type, assembly, version, publicKeyToken, and culture).  Mike Pope’s scenario involves the app_code directory and the Toolbox.  Not sure if it solve’s Mike’s problem, but I ran into 3 scenarios where I needed this.  I knew it could be done, but couldn’t find what the syntax was.  I pinged Devin Rader, and he was kind enough to reply:


add name=MyName type=MyClass, App_code />

Yes, case is significant here, or you will burn an hour or more trying to figure out what the proper search term is to find it on the web.

For more information on Partial Assembly References, see MSDN Online.

Thanks, Devin.