Monday, July 12, 2010

Using C# and VB.NET classes together in the App_Code folder

Create two folders under App_Code filder named CSCode and VBCode. Move Class1.cs inside CSCode folder and Class2.vb inside VBCode folder.


Error 1 The files ‘/VBandCSharptogether/App_Code/Class2.vb’ and ‘/VBandCSharptogether/App_Code/Class1.cs’ use a
different language, which is not allowed since they need to be compiled together.


if You got error this then add this following code to web.config file


<compilation debug="true">
<codeSubDirectories>
<add directoryName="CSCode"/>
<add directoryName="VBCode"/>
</codeSubDirectories>
</compilation>

No comments:

Post a Comment