3

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.

1
  • If you deploy, it will work. So don't worry about it. Commented Apr 19, 2016 at 8:40

1 Answer 1

4

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

Sign up to request clarification or add additional context in comments.

2 Comments

Note: It works, but you can't call C# code from VB and vice versa.
I found an online tool to convert C# to VB.NET and just recreated that one file. Just FYI

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.