When I debug my ASP.NET Web Site I get the following error:
The files
"/BookIt.Web/App_Code/VBCode/vCalendar.vb"and"/BookIt.Web/App_Code/CSCode/WebGrid/user/BenutzerCollection.cs"use different languages. This is not allowed, because they must be compiled together.
I don’t know how to fix that.
Someone can help me?
Stacktrace:
[HttpException (0x80004005): Die Dateien "/BookIt.Web/App_Code/VBCode/QueryStringModule.vb" und "/BookIt.Web/App_Code/CSCode/Webgrid/Dienstleistung/Servicegruppe.cs" verwenden unterschiedliche Sprachen. Dies ist nicht zulässig, weil sie gemeinsam kompiliert werden müssen.]
System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +452
System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +42
System.Web.Compilation.CodeDirectoryCompiler.GetCodeDirectoryAssembly(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories, Boolean isDirectoryAllowed) +640
System.Web.Compilation.BuildManager.CompileCodeDirectory(VirtualPath virtualDir, CodeDirectoryType dirType, String assemblyName, StringSet excludedSubdirectories) +125
System.Web.Compilation.BuildManager.CompileCodeDirectories() +265
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +320
[HttpException (0x80004005): Die Dateien "/BookIt.Web/App_Code/VBCode/QueryStringModule.vb" und "/BookIt.Web/App_Code/CSCode/Webgrid/Dienstleistung/Servicegruppe.cs" verwenden unterschiedliche Sprachen. Dies ist nicht zulässig, weil sie gemeinsam kompiliert werden müssen.]
System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +58
System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +512
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters) +729
[HttpException (0x80004005): Die Dateien "/BookIt.Web/App_Code/VBCode/QueryStringModule.vb" und "/BookIt.Web/App_Code/CSCode/Webgrid/Dienstleistung/Servicegruppe.cs" verwenden unterschiedliche Sprachen. Dies ist nicht zulässig, weil sie gemeinsam kompiliert werden müssen.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8921851
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +85
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +259
Simply put, you can’t mix languages in the same project. You can have a VB.NET project and a C# project in the same solution, one referencing the other. You use one compiler to compile a single project.
You can have code from several languages in the same project if the other languages are included as
Build Action: Content, notBuild Action: Compile. Of course, you won’t be able to use classes and logic from those files.Code files in the
App_Codefolder will, however, be automatically compiled