A detailed introduction to C # and VB.net hybrid development testing (GRAPHIC)

Source: Internet
Author: User
In the past, the development program software, basically is the use of a development language, either C #, either Java, or Delphi and the like. Recently saw some C # multi-project integration into a solution to develop the way, I think this is a good way. Let's build a simple example to feel the beauty of Microsoft's platform for multilingual development.

Development process:

1. New C # Windows program project

2. New VB Class Library project

Add a class library to just the C # project ("Add to Solution")

After the project has been completed, such as:

3, write VB Class library code

New test Method SayHello (), simple output information hint.

4. Add Project References

Add a project reference, the VB project, to your C # project.

5. Design form and write C # form event code

Using system;using system.windows.forms;using classlibrary1;namespace windowsformsapplication1{public    Partial Class Form1:form    {public        Form1 ()        {            InitializeComponent ();        }        private void Button1_Click (object sender, EventArgs e)        {            new Class1 (). SayHello ();}}}    

6. Test results

Multi-project hybrid development mainly has the following benefits:

Layered design, each layer can be independently developed to facilitate the division of labor;

Add references between the different projects, compile the DLL file, publish the DLL or source code according to your needs;

Modular development, to facilitate the formation of code assets, similar projects in the future only need to reference the relevant projects, to avoid referencing redundant code;

Another point is that the other language platform can not reach, is to play the advantages of different languages under the. NET platform, programmers using different languages can jointly develop a project.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.