[英]ASP.NET - App_Code - Mix VB and C# in the same folder
I use WebForms type.我使用 WebForms 类型。 and in my website project, there are pages which are using VB and also C#... It works!...
在我的网站项目中,有使用 VB 和 C# 的页面......它有效!......
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.....但问题是,如上图所示,我将“cs”文件和“vb”文件放在“App_Code”文件夹中,出现错误.....
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.
文件“/App_Code/BSN3.Class.cs”和“/App_Code/AssemblyInfo.vb”使用不同的语言,这是不允许的,因为它们需要一起编译。
Ok... I already solved the problem..好的...我已经解决了这个问题..
in Web.Config file, add code在 Web.Config 文件中,添加代码
<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' ..只需将 VB 和 CS 代码分成两个文件夹,分别是“VBCode”和“CSCode”..
so, it will look like this所以,它看起来像这样
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.