Microsoft Most Valuable Professional

Chris Pietschmann

An MVP From Wisconsin

ASP.NET 2.0: Use VB.NET and C# within the App_Code folder

When I was creating my new blog site (this site your looking at), I chose to write it in C#. I had a problem with the App_Code folder because I had some code in VB.NET code and some C# code I needed to put in there. I didn't want to rewrite my VB.NET code in the App_Code folder just so I could write the rest of the code for the site in C#.

Luckily, the ASP.NET Team had already thought about just this kind of circumstance. They implemented a way to partition the App_Code folder into sub-folders, one for each set of code files written in the same programming language. Awesome, I didn't have to spend a couple hours converting code from VB.NET to C#!

Even if you don't use multiple different programming languages for your code files in the App_Code folder, you could use this feature to organize your sets of related code files into sub-folders.

Step 1: Add the following lines to the web.config

[code:xml]
<configuration>
    <system.web>
        <compilation>
            <codeSubDirectories>
                <add directoryName="VB_Code"/>
                <add directoryName="CS_Code"/>
            </codeSubDirectories>
        </compilation>
    </system.web>
</configuration>
[/code]

Step 2: Create a sub-folder in the App_Code folder for each language you want to support.
For Example:
/App_Code/VB_Code
/App_Code/CS_Code

Step 3: Place your VB.NET code in the VB_Code folder and place C# code in the CS_Code folder.

Currently rated 4.2 by 5 people

  • Currently 4.2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: General
Posted by crpietschmann on Thursday, March 30, 2006 9:39 PM
Permalink | Comments (14) | Post RSSRSS comment feed


Are you ready to go Deeper in .NET!?

It's time for the Deeper in .NET 2006 event. This years event will be held Saturday April 22, 2006 at the Hyatt Regency Milwaukee. Registration is FREE for this full day packed full of excellent speakers, Free food and plenty of door prizes (books and software). You even have a chance to WIN a copy of MSDN Premium Subscription with Visual Studio 2005 Team Suite, worth over $10,000, if you register by April 18th!

I have attended the last two annual events, and my expectations have always been exceeded by the awesome speakers and content. If you're a .NET developer, you don't want to miss out.

Here is a tentative schedule of the day's event:

Time Speaker Description
7:00   Check In, Visit Sponsors & Networking
7:45 Scott Isaacs Introduction & Welcome
8:00 - 9:30 Michèle Leroux Bustamante WCF Top to Bottom
9:30 - 9:45 Break Visit Sponsors & Networking
9:45 - 11:15 Scott Hanselman Anatomy of a Successful ASP.NET Application: Inside DasBlog
11:15 - 12:45 Lunch Speaker Q&A Panel
12:45 - 2:15 Julia Lerman ADO.NET 2.0 Integration with SQL Server 2005
2:15 - 2:30 Break Visit Sponsors & Networking
2:30 - 4:00 Bill Hatfield AJAX and Atlas
4:00 - 4:15 Break Visit Sponsors & Networking
4:15 - 5:45 Jason Beres Using WPF to Create Compelling User Interfaces
5:45   Raffle Prizes - must be present to win

WI .NET Users Group - Deeper in .NET 2006

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:
Categories: General | WI-INETA
Posted by crpietschmann on Tuesday, March 28, 2006 11:35 PM
Permalink | Comments (0) | Post RSSRSS comment feed


About the author

I'm Chris Pietschmann, go to the About Me page to learn more about me.

Search

Sponsors

Web.Maps.VE - ASP.NET AJAX Virtual Earth Mapping Server Control

Recent comments

Disclaimer


This work is licensed under a Creative Commons Attribution 3.0 United States License, unless explicitly stated otherwise within the posted content.
© Copyright 2004 - 2008 Chris Pietschmann