aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies


Here I will explain how to solve the problem “the files use a different language which is not allowed since they need to be compiled together” when running web application using 


In previous article I explained JQuery autocomplete text with webservice. During work with that sample I created WebService in both the languages C# and VB.NET and I placed both languages code behind files in App_Code folder and I tried to run the application at that time I got error like “the files use a different language which is not allowed since they need to be compiled together” as shown below

I got this error because of using different language (C#, VB.NET) webservice class files in same App_Code folder. To solve this problem we need to create separate folders for C# code and VB.NET Code files in App_Code folder and place the C# code files in one folder and VB.NET code files in another folder and need to add some code in web.config file.
First Create two folders under App_Code folder and give name as CSCode and VBCode and move AutoCompleteService.cs file inside of CSCode folder and WebService.vb inside of VBCode folder and add following code in web.config
<compilation debug="true">
<add directoryName="CSCode"/>
<add directoryName="VBCode"/>
If you observe above code I added codeSubDirectories relating to App_Code folder and directoryName will represent a sub folder of App_Code folder. Once we set these configurations in web.config each sub folder will compile separately and respective class files will save in CSCode and VBCode files. After add code run your application it will work for you.

Happy Coding………

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


sivabalan k said...

Thank you so much sir.. its working..

Anonymous said...


Give your Valuable Comments

Other Related Posts

© 2010-2012 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.