Microsoft.AspNetCore.Cryptography.Internal.dll: 'Unable to load DLL 'kernel32.dll'

0

My computer is (lsb_release -a):

LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.4.1708 (Core) 
Release:    7.4.1708
Codename:   Core

and my dotnet core version (dotnet --version) is:

2.1.105

and my openssl version is:

openssl 
OpenSSL> version
OpenSSL 1.1.0h  27 Mar 2018

when I try to load my server I get the following error:

Exception has occurred: CLR/System.DllNotFoundException
Exception thrown: 'System.DllNotFoundException' in Microsoft.AspNetCore.Cryptography.Internal.dll: 'Unable to load DLL 'kernel32.dll': The specified module or one of its dependencies could not be found.
 (Exception from HRESULT: 0x8007007E)'
   at Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle.UnsafeNativeMethods.LoadLibraryEx(String lpFileName, IntPtr hFile, UInt32 dwFlags)
   at Microsoft.AspNetCore.Cryptography.SafeHandles.SafeLibraryHandle.Open(String filename)

My .csproj is:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <NeutralLanguage>pt-BR</NeutralLanguage>
    <Authors>Cogtive Team</Authors>
    <Company>Cogtive Opex Software</Company>
    <Product>Cogtive Core Api V2</Product>
    <PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
    <GeneratePackageOnBuild>false</GeneratePackageOnBuild>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DocumentationFile>bin\Debug\netcoreapp2.0\Cogtive.Core.Api.V2.xml</DocumentationFile>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.2.1" />
    <PackageReference Include="Microsoft.AspNetCore" Version="2.0.2" />
    <PackageReference Include="Microsoft.AspNetCore.ApplicationInsights.HostingStartup" Version="2.0.2" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.3" />
    <PackageReference Include="Microsoft.AspNetCore.ResponseCaching" Version="2.0.2" />
    <PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.0.2" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.2" />
    <PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.1" />
    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="2.3.0" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.1" />
  </ItemGroup>
  <ItemGroup>
    <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Cogtive.Core.Application\Cogtive.Core.Application.csproj" />
  </ItemGroup>
</Project>

rpm -q openssl returns:

openssl-1.0.2k-8.el7.x86_64

rpm -qa | grep openssl returns:

xmlsec1-openssl-1.2.20-7.el7_4.x86_64
openssl-devel-1.0.2k-8.el7.x86_64
openssl-1.0.2k-8.el7.x86_64
openssl-libs-1.0.2k-8.el7.x86_64

It was working fine until recently but now I can't make it work again.

my computer probably updated a library or something and now it's not working anymore.

any idea?

c#
linux
.net-core
asked on Stack Overflow Apr 23, 2018 by Bruno Lebtag • edited Apr 23, 2018 by Bruno Lebtag

1 Answer

0

That OpenSSL version looks very surprsing. Here is what I have on CentOS:

[omajid@localhost ~]$ rpm -q openssl
openssl-1.0.2k-8.el7.x86_64
[omajid@localhost ~]$ openssl
OpenSSL> version
OpenSSL 1.0.2k-fips  26 Jan 2017

Where did you get 1.1? Can you downgrade to 1.0? .NET Core is incompatible with 1.1.x: https://github.com/dotnet/corefx/issues/9855

answered on Stack Overflow Apr 23, 2018 by omajid

User contributions licensed under CC BY-SA 3.0