Search code examples
.net-6.0ef-core-6.0

Failed to load /snap/dotnet-sdk/152/shared/Microsoft.NETCore.App/6.0.1/libcoreclr.so Error


Previously I installed the .Net Core 3.1.416 version and dotnet-ef 3.1.416 version.

I used

dotnet-ef migrations add Test -p <path to domain layer> -s <path to solution file> --context ApplicationDbContext

command to add a database migration

then I have to install the .Net core 6.0.101 version SDK for a new project. Then I upgrade dotnet-ef 6.0.101 version.

Then I add migration at the .Net 6.0 project or 3.1.416 it throws the following error

Failed to load /snap/dotnet-sdk/152/shared/Microsoft.NETCore.App/6.0.1/libcoreclr.so, error: /snap/dotnet-sdk/152/shared/Microsoft.NETCore.App/6.0.1/../../../lib/x86_64-linux-gnu/librt.so.1: undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE
Segmentation fault (core dumped)

when I run dotnet --list-sdks command it shows the below output

3.1.416 [/usr/share/dotnet/sdk]
6.0.101 [/usr/share/dotnet/sdk]

Please help me to solve this problem


Solution

  • download dot-net runtime for dot-net 6.0 and dot-net 8.0

    sudo tar -xzvf dotnet-sdk-6.0.427-linux-x64.tar.gz -C /usr/share/dotnet
    
    sudo tar -xzvf dotnet-sdk-8.0.100-linux-x64.tar.gz -C /usr/share/dotnet
    

    Create symi link

    sudo ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet
    
    
    
    export DOTNET_ROOT=/usr/share/dotnet
    
    export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
    
    echo 'export DOTNET_ROOT=/usr/share/dotnet' >> ~/.bashrc
    
    echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc
    
    source ~/.bashrc
    

    if you face dotnet-sdk not found error use apt pagage to install

    dotnet installation link