netoops blog

Thursday, 18 October 2012

Using Multiple Programming Languages in ASP.NET Website



By default, the App_Code folder does not allow multiple programming languages. However, in a Web site project you can modify your folder structure and configuration settings to support multiple programming languages such as Visual Basic and C#. This allows ASP.NET to create multiple assemblies, one for each language. Developers commonly include multiple programming languages in Web applications to support multiple development teams that operate independently and prefer different programming languages.
For this you need to create a separate subfolder in App_Code folder for each of the programming language you want to support in your website. For the purpose of this tutorial I am adding CS and VB subfolders to support C# and Visual Basic source files.
After creating separate subfolders for each programming language, you must change the Web site project configuration so that ASP.NET will compile the subfolders separately. Open the web.config file of the website project and locate <compilation> the section in the file. You need to add the following <codesubdirectories> section inside the <compilation> section.

Add this in web config

<compilation>
  <codeSubDirectories>
    <add directoryName=”CS”/>
    <add directoryName=”VB”/>
  </codeSubDirectories>
</compilation>

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...