gpt4 book ai didi

c# - ASP.NET - App_Code - 在同一文件夹中混合 VB 和 C#

转载 作者:行者123 更新时间:2023-11-30 23:26:57 26 4
gpt4 key购买 nike

enter image description here

我使用 WebForms 类型。在我的网站项目中,有些页面正在使用 VB 和 C#... 它有效!...

但问题是,如上图所示,我将'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.

最佳答案

好的...我已经解决了问题..

在Web.Config文件中,添加代码

<compilation debug="false">
<codeSubDirectories>
<add directoryName="VBCode" />
<add directoryName="CSCode" />
</codeSubDirectories>
</compilation>

只需将 VB 和 CS 代码分开到两个文件夹中,即“VBCode”和“CSCode”..

所以,它看起来像这样

enter image description here

关于c# - ASP.NET - App_Code - 在同一文件夹中混合 VB 和 C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36712989/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com