是否有可能以静态项目之间共享代码,在C#中? [英] Is it possible to statically share code between projects in C#?
问题描述
是否有可能在C#,到Visual Studio项目之间共享代码的没有的需要分发一个DLL?
Is it possible, in C#, to share code between Visual Studio projects without needing to distribute a DLL?
我保持一些的由少数的Visual Studio C#项目,各建设一个简单的控制台可执行文件的软件。有很多的,我想搬出项目之间共享代码。我相信我可以把代码中的一个类库项目,但我宁愿避免套结对DLL与每个可执行文件的分发。
I'm maintaining some software that's composed of a few Visual Studio C# projects, each building to a simple console executable. There's a lot of shared code between the projects that I'd like to move out. I believe I can put the code in a Class Library project, but I'd rather avoid tacking on a DLL to distribute with each of the executables.
有什么办法解决此问题?我是新的C#,所以也许我想这一切反正错了 - ?有没有任何替代建议
Is there any way around this? I'm new at C#, so perhaps I'm thinking about this all wrong anyway - are there any alternate suggestions?
推荐答案
您可以使用ILMerge的类库与exe文件结合起来。
You can use ILMerge to combine the class library with the exe.
的 http://research.microsoft.com/en-us/people/mbarnett/ilmerge.aspx
这篇关于是否有可能以静态项目之间共享代码,在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!