Search This Blog

Loading...

Wednesday, March 28, 2007

C# and VB together?

I have an app in VS 2005 that contains both VB and C# code in the same project. At compile time I kept getting this error:

"The files '/WebSite/App_Code/VB/test.vb' and '/WebSite/App_Code/CS/test.cs' use a different language, which is not allowed since they need to be compiled together."

To go around this issue, simply add the following to your web.config file under the compilation tag:

<codeSubDirectories>
&ltadd directoryName="CS">
&ltadd directoryName="VB">


In this case, all the VB files and C# files were already separated into different folders inside the App_Code Folder.

Hope this helps.

0 comments: