Welcome to MSDN Blogs Sign in | Join | Help
Tip #26: Did you know... How to have C# and VB.NET files inside your App_Code directory?

If you are taking advantage of the App_Code folder to develop an ASP.NET WebSite some times you need to use code files that are written in different .NET languages. For example, you may want to use C# files and VB.NET files in the same web site:

image

To be able to do this you can use a feature of the compilation section in web.config to configure sub folders inside App_Code to be compiled separately.

<compilation debug="true">
    <codeSubDirectories>
        <add directoryName="VBFiles" />
    </codeSubDirectories>
</compilation>

Federico Silva Armas 
SDET, ASP.NET QA Team

Posted: Friday, November 21, 2008 11:13 AM by WebDevTools

Comments

Micky said:

But can you call code between them?  In other words, if I have a class in my C# code, can you call it from the VB.NET code.  I assumed the answer was "yes" but still haven't found a solution.

# November 21, 2008 10:22 PM

JoeReynolds said:

Can this be used with Web Application Projects?

# November 22, 2008 2:00 AM

Parsa said:

JoeReynolds, no, it's just for websites, not web applications

# November 22, 2008 10:36 AM

Rahul Chaukse said:

# January 6, 2009 5:52 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker