'System.Security.Cryptography.ProtectedData

2019-07-25 02:18发布

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?

1条回答
三岁会撩人
2楼-- · 2019-07-25 03:03

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

查看更多
登录 后发表回答