-
Notifications
You must be signed in to change notification settings - Fork 39
Runtime revision version mismatch can cause broken application to be installed #41
Comments
We now analyze dotnet binaries (except SingleFileBundles) and generate warnings if we believe that you're using the wrong framework. There are lots of checks and warnings to help you select the correct framework. This is done with no added external dependencies and has no impact to potential cross-platform developments in the future. If you do not publish a self contained application and do not add a --framework argument, you may see a warning such as
If you specify a --framework argument that was not found (in this example,
If you specify a --framework argument with a major.minor version that matches a valid online dotnet version, but your build version is higher than the latest online it will throw an error and fail the build
If you specify a --framework argument (eg.
All of this is designed to help you select the correct dotnet --framework but ultimately tries to not force anything on you. All of this is now also forward-compatible, so since we are using dotnet api's, changes will not be needed to support future versions of dotnet (eg. 6.1, 7.0, and so forth). |
This has been released in 2.8.1-pre. |
Perfect! Thanks for this fix. |
This is a bug in the SDK, see
the changes here should not be needed for future versions of the SDK. |
When installing .net 5/6 applications, Squirrel will allow an application to be installed if the major version matches. Eg, using the
--framework net6
argument, Squirrel only verifies that any version of net6 is installed (6.0.0, 6.0.1, etc).If an application depends on a higher version (6.0.1) and a lower version is installed (6.0.0) this can produce extremely undesirable behaviour. The user does not even get the expected "Net 6 is not installed, click here to download" dialog, which is shown when no version of net6 is installed. Instead, the exe can just silently crash if they require code from the higher runtime version.
It will be important to support this properly to ensure people do not install broken applications.
One option is to require application authors to be extremely specific about what version the application is built for (eg
--framework net602
instead of just--framework net6
).Another option might be using a tool like ildasm and reading the dll manifest references which are version specific. We could detect the highest required version and then automatically make sure it's lower to or equal to the installed runtime during setup. Possibly PeNet can read this manifest already rather than shipping another external tool. (edit: PeNet can load the CLR MetaData Tables and look at AssemblyRef, but only MajorVersion is shown on http://penet.io/ - need to have a look at code and see if we can get minor/revision too. ILSpy can show the full version, so presumably it's possible)
See more RandomEngy/VidCoder#979
This issue does not impact the full framework or vcredist as major/minor/revision versions are already considered there; this issue only impacts netcore3 and net5/6.
The text was updated successfully, but these errors were encountered: