Dabo
Dabo

Reputation: 381

How can I verify a .NET self-contained single file executable?

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)?

Upvotes: 2

Views: 1128

Answers (1)

Reilly Wood
Reilly Wood

Reputation: 2142

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.

Upvotes: 2

Related Questions