Home  >  Article  >  Backend Development  >  Detailed introduction to mixed development and testing of C# and VB.net (pictures and text)

Detailed introduction to mixed development and testing of C# and VB.net (pictures and text)

黄舟
黄舟Original
2017-03-15 11:09:213545browse


In the past, programming software was basically developed using a development language, either C#, Java, or Delphi. Recently, I have seen some development methods of merging multiple C# projects into one solution, and I think this method is good. Below we will create a simple example to experience the charm of Microsoft platform multi-language development.

Development process:

1. Create a new C# Windows program project

2. Create a new VBclass library project

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

After building the project, the following picture is shown:

3. Write VB class library code

Create a new test method SayHello() and simply output information prompts.

4. Add project Reference

Add project reference in C# project, that is, VB project.

5. Design forms and write C# formsEventCode

# #

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 mixed development mainly has the following benefits:

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

Just add references between different projects. After compilation, it will be a

Dl

l file. When publishing, you can decide whether to publish Dll or source code according to your needs;

Modular development

facilitates the formation of code assets. In the future, similar projects only need to reference related projects to avoid citing redundant code; There is another point that other language platforms cannot reach now. What is achieved is that the advantages of different languages ​​​​under the .net platform can be used, and programmers using different languages ​​​​can jointly develop a project.

The above is the detailed content of Detailed introduction to mixed development and testing of C# and VB.net (pictures and text). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn