C# and VB.NET playing nice in the ASP.NET 2.0 Playground
I've been finding so much cool sh1t in the newest build of Whidbey that it's hard to keep up. It's really amazing how, when you actually have to build something professionally, you come across so much more than you ever would just tinkering through it. Well, I was editing my web.config file and saw some neat stuff on the <compilation> node. It got me to wondering what all was happening with it and after a little investigation, I found out about the “\Code” folder. I'll explain more later on what Code is all about, but suffice to say that if you try to add a Class to your web site, it will recommend you put it in code. The dialog that pops up will allow you to choose your language (J#, C# or VB.NET) which is a big clue that you can do something cool. So in a nutshell, you can have VB.NET and C# source code, sitting IN THE SAME ASSEMBLY!!!! and they'll play nice together. It takes a tiny bit of tweaking in the config file, but even a VB6 programmer can handle it. First, for each language, you need a directory under the Code folder. You can get pretty nice from there so don't think that it's stopping you from organizing your code. I made two directories named surprisingly enough, CSharpStuff and VBStuff. Then I added a directoryName for each of them:

After that I added a C# class underneath the CSharpStuff folder and some VBCode under the VBStuff folder (and yes, if I wanted to be cute I could have put CSharp code in the VB folder and vice versa and it would work). NOw, the neat part is that they are visible to each other - so namespaces aside, CuckooConcrete directly inherits from CuckooBase: