打包 C# 类库 (DLL) 的推荐方法是什么?

发布于 2024-07-30 07:11:52 字数 62 浏览 4 评论 0原文

我正在创建一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

翻身的咸鱼 2024-08-06 07:11:53

那么,您使用过其他第三方吗? 您希望在完美打包的第三方下载中看到什么?

我将至少包含以下内容将其压缩:

  • /bin/ 文件夹中的 dll
  • 自述文件(txt 或 html)解释它是什么,如何安装以及在哪里获取更多信息(

如果您包含源代码)
* 源代码位于/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:

  • your dll in a /bin/ folder
  • readme (txt or html) explaining what it is, how to install and where to get more info

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?

哎呦我呸! 2024-08-06 07:11:53

如果它只是一个 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.

挽你眉间 2024-08-06 07:11:53

查看第 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!

你丑哭了我 2024-08-06 07:11:53

是的。

您应该在 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.

晨曦慕雪 2024-08-06 07:11:53

我建议,如果这是一个产品,您需要一个安装它的安装项目。 这包括将其放置在 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.

情未る 2024-08-06 07:11:52

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文