Missing System.Security.Claims dll

240 Views Asked by At

I am a newbie to ASP.net attempting to publish a .netcore3.1 app to my companies test server; the app compiles and runs fine on my machine and seems to publish okay, but when attempting to run on the server I get:

 "HTTP Error 500.19 - Internal Server Error" 

which directs me to review the event logs...which reveals the following exception with stacktrace:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Security.Claims, 
Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the 
file specified.

File name: 'System.Security.Claims, Version=5.0.0.0, Culture=neutral, 
PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.GetUser
at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.Invoke(HttpContext httpContext)
at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.Invoke(HttpContext context)
at 
Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext] 
(IHttpApplication`1 application)

Only post which seemed related was this. System.Security.Claims missing

I've tried adding the system.security.claims package in NuGet and republishing, but System.Security.Claims only goes up to version 4.3.0...yet this is asking for 5.0, which doesn't seem to exist...System.Security.Principal has a v5.0 but adding that doesn't do anything.

Is there any way to resolve what exactly is causing this dependency from the stack trace and where to get the dll from, if possible?

Thanks.

0

There are 0 best solutions below