runtime: dotnet-host 2.1.0-preview2-26406-04-1 is not backwards compatible with 2.0.x applications: Failed to resolve library symbol hostfxr_main_startupinfo
I’m seeing multiple reports that 2.0.x runtimes no longer launch due to failures in loading libhostfxr.so
https://github.com/travis-ci/travis-ci/issues/9467 https://twitter.com/bradwilson/status/983782235777024000
Repro
On a clean machine, configure feeds as described on https://www.microsoft.com/net/download/linux-package-manager/ubuntu16-04/sdk-current
sudo apt-get install dotnet-sdk-2.1.104
dotnet --info
Expected
Stable releases of .NET Core should still work and only install stable versions of the dotnet-host
package.
Actual
The installation brings down the prerelease dotnet-host
package, version 2.1.0-preview2-26406-04-1, which issues this warning before exiting with and error code.
Failed to resolve library symbol hostfxr_main_startupinfo, error: /usr/share/dotnet/host/fxr/2.0.0/libhostfxr.so: undefined symbol: hostfxr_main_startupinfo
Workaround
Downgrade the dotnet-host
package to an older version
sudo apt install dotnet-host=2.0.6-1
@steveharter @Petermarcu @leecow - preview2 impacting
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 30 (21 by maintainers)
This seems to be broken still on the RPM repos. As a hack and workaround, I changed the dotnetdev.repo as follows:
This allows us to rip & install any dotnet packages and not get the preview packages… Now to start doing this across our environments…
Installing
dotnet-sdk-2.1.104
also ends up installing thedotnet-runtime-deps-2.1.0-preview2-26406-04
package.I don’t think you should be publishing preview packages on the same feed as the release packages.
@steveharter Is there an issue for this that I can follow?
A script friendly way to do this on machines you haven’t already fixed up as per my suggestion:
FYI: On a fresh CentOS 7 box installing
dotnet-sdk-2.1.4
(or 2.1.3 or even 2.0.3) from the RHEL repo also pulls indotnet-runtime-deps-2.1.0-preview2-26406-04
. Trying to uninstall it afterwards removes all of dotnet again. I am seeing the samehostfxr_main_startupinfo
errors as mentioned in the initial report.Please just mention me if you need any additional information.
So there is 1 bug in the host package which Rakesh has fixed. This had the runtime-deps dependency on dotnet-host rather than dotnet-runtime. Because dotnet-host is the only package (at the moment) that is seen as upgradable by the package managers, the latest is always brought in.
A possible workaround for Ubuntu/Debian folks that have been hit by this is the following:
apt-cache madison dotnet-host
: this will return a list of all versions available on the feedapt-get install dotnet-host=[version you want from the list returned by madison]
@leecow I can confirm that the version of the dotnet-host preview package that gets installed no longer causes the crash (from the Ubuntu feed at least.)
However, I still don’t understand why it’s considered okay that installing a released version of the SDK or runtime installs preview packages in the first place. If I’m installing .NET Core on a production machine, I definitely don’t want preview packages installed on it.
@joalcava - You can use the same as I suggested above - but change the yum commands for dnf.
@leecow Removing the preview1 package has gotten everything working correctly again.
Alrighty - run apt-get update then apt-cache madison and you should see no 2.1.0 Preview packages.