简体   繁体   中英

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

在此处输入图片说明

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.

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

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM