Rider unable to run builds in .NET 6 due to failure to load hostfxr file


Recently we upgraded our project from .NET 5 to .NET 6 and for the rest of my team this does not seem to be a problem, as within Visual Studio it is able to build and then run just fine (same for dotnet cli tool). However as I like to use Rider it poses a problem for me: Rider is able to build the project just fine, but when running it, it fails to load the 'hostfxr'.

I am then presented with the following error message:

It seemed as it the following forum post was dealing with a similar problem (https://rider-support.jetbrains.com/hc/en-us/community/posts/4517401204114-Unit-tests-not-working-in-Rider-2021-3-3- ), however the solution mentioned in the post (to provide a path to the dotnet executable as an environment variable) does not seem to work in my instance and the linked issue can no longer be found.


Hello, it looks like you faced the following known issue. Could you please try using another Toolset if possible or define an environment variable called DOTNET_ROOT(x86) and let me know how it goes? 


Hey, setting the toolset and executable to x86 did indeed solve the issue for me.


Please sign in to leave a comment.