我可以把一个大dll分成1 dll每班吗? [英] Can I separate a big dll into 1 dll per class?

查看:116
本文介绍了我可以把一个大dll分成1 dll每班吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在Visual Studio 2008中的C#项目中构建2个或更多的dll吗?,另外一个想法是只创建一个大项目。之后,我通过使用post-build事件来调用Win应用程序项目(用于分开一个大的dll),将一个项目dll(包含许多类)分成1个dll。如何做到这一点?



此外,我还需要在一个大的dll中管理附件。



更新
我发现一些技巧可以指导我通过自定义构建来解决这个问题?此外,我想我可以创建自定义处理程序,通过使用单独的模块文件& Al.exe工具。但是这个功能超出了我的期望和不公平(源代码很少改变)。



多文件装配:什么和如何



如何:构建一个Multifile程序集



POCO Custom Multifile Assembly and ReSharper



谢谢,

解决方案>

这个问题是由另外一个问题解释的MSBuild的自定义脚本解决的。

 < ItemGroup> 
< Compile Include =Class1.cs>
< Plugin> true< / Plugin>
< / Compile>
< Compile Include =Class2.cs/>
< Compile Include =Class3.cs>
< Plugin> true< / Plugin>
< / Compile>
< Compile Include =Program.cs/>
<编译包含=属性\AssemblyInfo.cs/>
< / ItemGroup>

Visual Studio一个项目与几个dll作为输出



感谢@franko_camron的建议。


From Can I build 2 or more dlls from C# project in Visual Studio 2008?, I have another idea to create only 1 big project. After that, I separate a project dll(that contains many classes.) into 1 dll per class by using post-build event to call Win app project(for separate a big dll). How to do this?

Moreover, I need to manage attached file in a big dll too.

Update I found some trick that could guide me to solve this problem by custom build? Moreover, I think I can create custom handler that generate dynamic assembly file by using separate module file & al.exe. But this feature is over my expect and unnessary(sourcecode is rarely changed).

Multi-file Assemblies: What and How

How to: Build a Multifile Assembly

POCO Custom Multifile Assembly and ReSharper

Thanks,

解决方案

This problem is solved by custom script for MSBuild that was explained in another question.

<ItemGroup> 
  <Compile Include="Class1.cs"> 
    <Plugin>true</Plugin> 
  </Compile> 
  <Compile Include="Class2.cs" /> 
  <Compile Include="Class3.cs"> 
    <Plugin>true</Plugin> 
  </Compile> 
  <Compile Include="Program.cs" /> 
  <Compile Include="Properties\AssemblyInfo.cs" /> 
</ItemGroup> 

Visual studio one project with several dlls as output?

Thanks @franko_camron for suggestion.

这篇关于我可以把一个大dll分成1 dll每班吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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