Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'System.Security.Cryptography.ProtectedData', version: '4.4.0' can not be found

I'm trying to deploy a .NET Core application on Windows Server 2012 Datacenter.

I have installed .NET Core Windows Server Hosting bundle and also made sure uCRT is installed (installed it manually)

By executing dotnet assemblyname.dll I'm receiving this error:

Error: An assembly specified in the application dependencies manifest (program_name.deps.json) was not found: package: 'System.Security.Cryptography.ProtectedData', version: '4.4.0' path: 'runtimes/win/lib/netstandard2.0/System.Security.Cryptography.Protecte dData.dll'

I Googled around, but couldn't find the problem and how to solve it. What is the problem, and how should I solve it?

like image 391
mohammad rostami siahgeli Avatar asked May 13 '26 06:05

mohammad rostami siahgeli


1 Answers

Ensure there is a runtimes folder under your root application directory. I myself ran into this problem earlier.

In my case, I was doing a robocopy to a publishing directory and was not using the /S (or /E) flag to copy the sub-directories. Using these flags ensured the runtimes folder was there at the destination site and my application then ran without the exception in question.

The entire relative path to the .dll from where the application is running should be: .\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll

like image 144
Mike-E Avatar answered May 14 '26 20:05

Mike-E



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!