简体   繁体   English

如何在C#项目的App_Code文件夹中一起使用VB.NET类

[英]How to Using VB.NET classes together in the App_Code folder for C# project

Hi I have a webservice project using C# project. 嗨,我有一个使用C#项目的Web服务项目。 Currently I have a vb file that I want to use. 目前,我有一个要使用的vb文件。 I put it on a folder name ,VBCode, inside the App_Code. 我将其放在App_Code内的文件夹名称VBCode上。 I also follow the Using C# and VB.NET classes together in the App_Code folder . 我还将在App_Code文件夹中同时使用Using C#和VB.NET类 I added the namespace and modified the webconfig. 我添加了名称空间并修改了webconfig。 However when I complied it that I got a lot of error such as ";expecting". 但是,当我编译它时,出现了很多错误,例如“; expecting”。 Is it possible to have vb file in C# project. 是否可以在C#项目中使用vb文件。

 <codeSubDirectories>       
    <add directoryName="VBCode"/>
  </codeSubDirectories>

In theory, the answer is yes and you are doing the configuration in the right way. 从理论上讲,答案是肯定的,并且您以正确的方式进行配置。 however this an old tricky code. 但是,这是一个古老的棘手代码。 I suggested migrating the code to C#. 我建议将代码迁移到C#。

Anyway, you can find more information on these answers associated with the same question here in Stackoverflow. 无论如何,您可以在Stackoverflow中找到与相同问题相关的这些答案的更多信息。

Mixing C# & VB In The Same Project 在同一项目中混合C#和VB

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM