Using C# and VB in the same ASP.NET website.

.NET framework allows us to use different languages in the same application. .Net compiler will not allow C# and VB files in the same directory. To overcome this problem, either we could create a directory only for VB language under App_code or  create a directory for each language.

Create a directory for each language under App_Code Directory.

--App_Code
   --VB (Only VB files)
   --CSharp(Only C# files)

Following changes needs to be made to the web.config:

  <system.web>

    <compilation debug="true">

      <codeSubDirectories>

        <add directoryName="VB"/>

          <add directoryName="CSharp"/>

      </codeSubDirectories>

    </compilation>

  </system.web>


Or

--App_Code
   --VB (Only VB files)
--(Only C# Files)


Following changes needs to be made to the web.config:

  <system.web>

    <compilation debug="true">

      <codeSubDirectories>

        <add directoryName="VB"/>

      </codeSubDirectories>

    </compilation>

  </system.web>

  

 



Alternate Titles: Use of C# and VB in the same project, Compiling C# and VB in the same Website, WEB.CONFIG settings for having C# and VB in the same application,codeSubDirectories settings