views:

70

answers:

1

While adding two language code files i.e. C# and VB.NET to App_Code, got an error

 The files ... file names ... use a different language,  
 which is not allowed since they need to be compiled together.

Is there a way to add two different language files?

+1  A: 

Create sub folders and put all your VB code in one folder and C# in the other. In your case you will have one for C# and the other one for VB

You will need to modify web.config under the compilation element to include these so that the compiler will know to include them in the compilation

<codeSubDirectories>
   <add directoryName="MyVBCode"/>
   <add directoryName="MyCSharpCode"/>
</codeSubDirectories>
Fadrian Sudaman
This is nearly an identical answer to gabe's in http://stackoverflow.com/questions/2339776/mixing-vb-net-and-c-code-in-an-asp-net-web-application/2339827
Yuriy Faktorovich
Yeah just saw the link posted on the comment above. An example of concurrency issue :) Gabe answer provided on the link above provided more insight, so please refer to that. I just voted for it too
Fadrian Sudaman
Yes, I think some mods should vote to close this question.
Gabe