Syamsoul Azrien Syamsoul Azrien - 7 months ago 20
Vb.net Question

ASP.NET - App_Code - Mix VB and C# in the same folder

enter image description here

I use WebForms type. and in my website project, there are pages which are using VB and also C#...
It works!...

But the problem is, as you can see on the picture above, I put 'cs' file and 'vb' file in 'App_Code' folder, and there are Error appear.....


The files '/App_Code/BSN3.Class.cs' and '/App_Code/AssemblyInfo.vb'
use a different language, which is not allowed since they need to be
compiled together.

Answer

Ok... I already solved the problem..

in Web.Config file, add code

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

And just seperate VB and CS code into two folder which are 'VBCode' and 'CSCode' ..

so, it will look like this

enter image description here

Comments