使用C#和VB.NET中的一个解决方案 [英] Using C# and VB.NET in one solution

查看:496
本文介绍了使用C#和VB.NET中的一个解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我忙上一个小项目到ACCESS2003转换分贝.NET。我想我的功能,但其被用于某种管理现有项目进行整合。在这个项目中的代码是VB.net。

I'm busy on a small project to convert an Access2003 db to .NET. I am trying to integrate my functionality in an existing project that is being used for Administration of some kind. The code in this project is VB.net.

我开始通过设置我的数据访问层,这似乎很好地工作。我可以访问我所需要的数据的新网页。然而,当我开始使用类文件来建立我的业务逻辑层使用C#而不是VB的时候我不能建立我的项目。我不喜欢VB和喜欢C#编程,因为我知道的语法好了很多,等是否有可能使用C#明知是VB.NET语言选择建立在整个项目的计划?

I started by setting up my Data Access Layer, which seems to work fine. I can make new web pages that access the data I need. However when I start to use class files to set up my Business Logic Layer I can't build my project when using C# instead of VB. I dislike VB and like to program in C# as I know the syntax a lot better, etc. Is it possible to program using C# knowing that VB.NET was the language chosen to build the entire project on?

如果没有,什么将是我的模块集成到使用我最喜欢的编程语言项目中的最聪明的方式? (做一个项目,并引用该dll?)

If not, what will be the smartest way to integrate my module into the project using my favorite programming language? (Make a project and reference to the dll?)

编辑:所以我的问题是下一步 - >

So the next step in my question would be -->

如果我在现有解决方案中建立一个新的项目,我可以使新项目包含现有的我的一个业务逻辑层+数据访问层和参考?

If I set up a new project within the existing solution, can I make that new project contain my Business Logic Layer + Data Access Layer and reference from my existing one?

推荐答案

是的,你不能在相同的项目的混合语言,但你可以添加不同语言编写的,只要你喜欢,因为很多项目,到相同的溶液。 (这有时是非常有用的,尤其是当它涉及到已经写在C部分++ / CLI,这是能够做到的事情是不可能做到在C#/ VB.NET)。

Yes, you can't mix languages within the same project, but you can add as many projects written in different languages as you like, to the same solution. (This is sometimes very useful, especially when it comes to having portions written in C++/CLI, which are able to do things which would be impossible to do in C#/VB.NET.)

这篇关于使用C#和VB.NET中的一个解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆