gpt4 book ai didi

c# - 'System.Security.Cryptography.ProtectedData',版本 : '4.4.0' can not be found

转载 作者:行者123 更新时间:2023-12-05 01:43:53 25 4
gpt4 key购买 nike

我正在尝试在 Windows Server 2012 Datacenter 上部署 .NET Core 应用程序。

我已经安装了.NET Core Windows Server Hosting bundle并确保安装了 uCRT(手动安装)

通过执行 dotnet assemblyname.dll 我收到此错误:

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'

我用 Google 搜索了一下,但找不到问题所在以及解决方法。问题是什么,我该如何解决?

最佳答案

确保在您的应用程序根目录下有一个 runtimes 文件夹。我自己早些时候遇到过这个问题。

在我的例子中,我正在对发布目录执行 robocopy,并且没有使用 /S(或 /E)标志复制子目录。使用这些标志可确保 runtimes 文件夹位于目标站点,然后我的应用程序可以正常运行,不会出现相关异常。

从应用程序运行的位置到 .dll 的完整相对路径应该是:.\runtimes\win\lib\netstandard2.0\System.Security.Cryptography.ProtectedData.dll

关于c# - 'System.Security.Cryptography.ProtectedData',版本 : '4.4.0' can not be found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48237249/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com