通过网络发送 C# Assembly/DLL?

Send C# Assembly/DLL Over Network?

我的目标是让我的服务器在运行时通过网络发送客户端需要的一些 类 的程序集。这样,客户端 DLL 根本不需要更新。我想知道是否有比发送完整的 DLL 文件更好的方法来做到这一点?我正在使用 TCP 连接。

对于任何担心此选择的安全性的人,我们在一个只有有线的本地网络上,没有人可以访问,但受信任的客户端。

您描述的问题是 ClickOnce 旨在解决的问题。来自 ClickOnce Documentation:

ClickOnce is a deployment technology that enables you to create self-updating Windows-based applications that can be installed and run with minimal user interaction. Visual Studio provides full support for publishing and updating applications deployed with ClickOnce technology if you have developed your projects with Visual Basic and Visual C#.

其中最重要的方面之一是安全性。例如,如何验证程序集对 运行 来说是安全的,程序集是否来自正确的来源等。 而不是 构建自定义实现的一个主要好处是您使用的是行业标准和经过审查的机制。 ClickOnce 使用证书。