Today I have seen the following:

Babo.UI.Library.Forms.MessageBox.Show("Text.", "Caption", MessageBoxButtons.OK, MessageBoxIcon.Error);

It seems, that the coder uses his own assembly. Whenever I create a new application, I copy and paste my code from A to B. Can I create and use my own assembly, too? Are there any code samples? Thanks in advance. Kind regards. ;)

有帮助吗?

解决方案

Create a class library. It will compile to a dll, which can then be added to your project.

Check out this article.

其他提示

Just create a Class Library project in Visual Studio and it will generate a dll (aka assembly) on compilation.

In fact, every exe or dll created in .NET is called an assembly.

When you want to reuse that, add the generated assembly as reference in your project, either by selecting it's file or, if in the same project, use a project reference.

You can just create a new Class Library project and reference to it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top