简体   繁体   中英

How to separate Class Library into multiple assembly (*.dll)?

I build a class library project with separate class by folder.

Example:

  • TEST
    • Security
    • Converter
    • Utility

After I compile project, I will have

but I want TEST.dll, TEST.Security.dll, TEST.Converter.dll, & TEST.Utility.dll

Security, Converter, Utility is folder in TEST project. 安全性,转换器,实用程序是TEST项目中的文件夹。 In each folder have c# class.

How to do?

Create separate projects for each

Example:

  • name project class library 类库
  • name project class library 类库
  • name project class library 类库

the fact that you separate classes by folders means nothing when it comes to the dll output.

If you want one dll per folder then you will have to create one separate class library project for each one. In the properties of each project you can set the name of the dll file itself.

This being said, the name of the dll is less important, it's the namespaces that will matter. The namespace is set in each class file and this will affect your "using" statements.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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