如何验证 .NET 自包含的单个文件可执行文件?
我正在为 .NET 运行时编写的客户端发布一个 C# 应用程序,作为单个文件发布,即我正在使用 --self-contained true -p:PublishSingleFile=true -p:InincludeNativeLibrariesForSelfExtract=true
对于 dotnetpublish
命令
没有修剪,不包括运行时。
该应用程序具有多个托管和非托管依赖项。
该应用程序使用 NUnit(在发布模式下)进行了广泛的单元测试。然而,客户询问我如何确定部署的可执行文件与正在测试的编译产品“相同”。 (暂时搁置单元测试环境和生产环境之间的差异。)
我可以验证提取到文件系统 ($HOME/.net) 的本机库与捆绑之前的库相同。但是托管代码呢?是否可以检查单文件可执行文件并验证捆绑的应用程序是否由相同的单元测试产品(DLL)组成?
I am releasing a C# application for a client written for the .NET runtime, published as a single file, i.e. I am using--self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
for the dotnet publish
command
No trimming, runtime not included.
The application has multiple managed and non-managed dependencies.
The application is extensively unit-tested using NUnit (in release mode). However, the client is asking how I am certain that the deployed executable is 'the same as' the compiled product under test. (Put aside for now the differences between the unit test environment and the production environment.)
I can verify that the native libraries extracted to the filesystem ($HOME/.net) are the same as the libraries prior to bundling. But what about the managed code? Is it possible to inspect the single-file executable and verify that the bundled application is composed of the same unit-tested products (DLLs)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SingleFileExtractor 是一个用于处理单文件 .NET 应用程序的有用工具。您可以使用它从 exe 中提取 DLL,然后将它们与在发布模式下测试时编译的 DLL 进行比较。
SingleFileExtractor is a useful tool for working with single-file .NET applications. You could use it to extract the DLLs from the exe and then compare them to the DLLs compiled when testing in release mode.