简体   繁体   English

如何在 C# 解决方案中包含 VB 项目

[英]How to include a VB project in a C# Solution

I am very new to C# and visual studio and I am currently playing around with the idea that multiple languages can be mixed in a solution (C# project and VB project in the same solution).我对 C# 和 Visual Studio 非常陌生,我目前正在考虑可以在一个解决方案中混合多种语言的想法(C# 项目和 VB 项目在同一个解决方案中)。 I found what seems to be a stupid simple tutorial:我发现似乎是一个愚蠢的简单教程:

https://dailydotnettips.com/back-to-basic-can-we-use-both-c-and-vb-project-with-in-a-single-visual-studio-solution/ https://dailydotnettips.com/back-to-basic-can-we-use-both-c-and-vb-project-with-in-a-single-visual-studio-solution/

However, it says:但是,它说:

Here is one simple walkthrough on using this..

1.) Run a new instance of Visual Studio
2.) Create a new C# Console Application Project.
3.) Add a new “Visual Basic Project” using “Add New Project” dialog window”
4.) Add the VB Class Library Project as Reference to C# Project.

So I of course was able to accomplish step 1.所以我当然能够完成第 1 步。

On step 2 I created a "C# windows forms application," but I don't see how that is a problem.在第 2 步中,我创建了一个“C# windows forms 应用程序”,但我不明白这是怎么回事。

On step 3.) I added a VB console application在第 3 步。)我添加了一个 VB 控制台应用程序

I am stuck on step 4. When I right click the C# project and select add and select add reference... I don't see "VB Class Library." I am stuck on step 4. When I right click the C# project and select add and select add reference... I don't see "VB Class Library." Am i doing something wrong?难道我做错了什么? Is it actually called something else?它实际上被称为别的东西吗? I am using Visual Studio 2015... Is it called something else in VS 2015?我正在使用 Visual Studio 2015 ......它在 VS 2015 中被称为其他东西吗?

I added a VB console application我添加了一个 VB 控制台应用程序

And why would you think that that was a good idea, given that step 4 specifically refers to a VB Class Library Project?鉴于第 4 步专门针对 VB Class 库项目,您为什么认为这是个好主意? If you are told that you need a Class Library project, add a Class Library project.如果您被告知需要 Class 库项目,请添加 Class 库项目。 The screenshot even names the project "VBClassLibrary"/屏幕截图甚至将项目命名为“VBClassLibrary”/

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

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