打包 C# 类库 (DLL) 的推荐方法是什么?
我正在创建一个 C# 类库供其他开发人员使用。 我应该如何打包它——只需压缩 DLL 并将其放在网站上即可?
I am creating a C# class library for use by other developers. How should I package it up - just zip up the DLL and put it on the website?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
那么,您使用过其他第三方吗? 您希望在完美打包的第三方下载中看到什么?
我将至少包含以下内容将其压缩:
如果您包含源代码)
* 源代码位于/source/文件夹中
* /tests/ 文件夹中的任何测试
如果它很好,您可能想将其粘贴到 google code 或 codeplex 而不是您自己的网站上?
Well, have you ever used another third party one? What would you like to see in the perfectly packaged third party download?
I'd zip it up with the following in at a minimum:
if you are including the source then
* source in /source/ folder
* Any tests in a /tests/ folder
If its something good you might want to stick it up on google code or codeplex rather than your own site?
如果它只是一个 DLL,那么我就不会费心压缩它。 但是,如果您确实将一些文档与示例配置文件(如果适用)一起压缩,那就太好了。
If it is just a DLL then I wouldn't bother zipping it. However it would be nice if you did zip up some documentation with it along with a sample configuration file if applicable.
查看第 3 方项目以获取灵感,但是,压缩的 dll 就可以了。
如果您的文档很大,那么您应该将其放入单独的 zip 中,如果您发布源代码,则应该将其放入第三个 zip 中。
无论哪种方式,您的 dll 都应该附带一个自述文件,描述它是什么版本、目的是什么、谁编写的以及如何与他们联系,以及任何依赖项或其他有用的信息片段。
文档真的很重要!
Look at 3rd party prijects for inspiration, but yes, a zipped dll is fine.
If your documentation is large then you should put it into a separate zip, and if your releasing the source you should put that into a 3rd zip.
Either way your dll should comes with a readme describing what version it is, what the purpose is, who wrote it and how to get in touch with them, along with any dependencies or other useful snippets of information.
Documentation is really important!
是的。
您应该在 ZIP 文件中包含文档,包括返回您网站的链接。 NDoc 非常适合从 XML 注释生成文档。
Yes.
You should include documentation in your ZIP file, including a link back to your website. NDoc is great for generating documentation from your XML comments.
我建议,如果这是一个产品,您需要一个安装它的安装项目。 这包括将其放置在 GAC 中并将文档留在某处。
编辑
只是为了澄清一下,我指的是真正的文档,而不仅仅是从评论中自动生成的文档。
I would suggest that, if this is a product, you would want a setup project that installs it. This would include placing it in the GAC and leaving documentation somewhere.
edit
Just to clarify, I mean real documentation, not just what's automatically generated from comments.
推荐的方法是将包含构建脚本的代码源上传到网站,例如 googlecode 以便其他开发人员可以下载它并编译它,但如果它是闭源库,则压缩程序集 (mylibrary.DLL)、文档 (mylibrary.XML) 和调试信息文件 (mylibrary.PDB) 就足够了。
The recommended way is to upload the code source including build scripts to a web site such as googlecode so that other developers could download it and compile it but if it is closed source library zipping the assembly (mylibrary.DLL), documentation (mylibrary.XML) and debug information file (mylibrary.PDB) should be enough.