The ASP.NET Capsule #18: Running C# & VB.NET in the same web application

Hi all.

You know, sometimes you just find some code on the Internet or a colleague handed out a piece of code written in a language other than the one you use.

Well, fear no more. Just modify your Web.Config file to include the other compiler and off you go.

<system.codedom>
<
compilers>

<compiler language=c#;cs;csharp extension=.cs  type=Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 warningLevel=4>
     <
providerOption name=CompilerVersion value=v3.5 />
     <
providerOption name=WarnAsError value=false />
</
compiler>

<compiler language=vb;vbs;visualbasic;vbscript extension=.vb type=Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 warningLevel=4>
     <
providerOption name=CompilerVersion value=v3.5 />
     <
providerOption name=OptionInfer value=
true
/>
     <
providerOption name=WarnAsError value=false />
</
compiler>

</compilers>
</
system.codedom>

 

Enjoy!



Leave a Reply

Your email address will not be published. Required fields are marked *