首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CSharpScript -无法加载System.Security.Cryptography.Algorithms

CSharpScript -无法加载System.Security.Cryptography.Algorithms
EN

Stack Overflow用户
提问于 2022-09-02 10:09:10
回答 1查看 25关注 0票数 0

我正在网站.NET框架4.7.2工作,我想使用CSharpScript库。我安装了Microsoft.CodeAnalysis.CSharp.Scripting 4.3.0,并在控制器中创建了方法:

代码语言:javascript
复制
// GET: Test
[AllowAnonymous]
[HttpGet]
public async Task<ActionResult> Index()
{
    var obj = await CSharpScript.EvaluateAsync("new{x=1}");
    return View();
}

但是当我调用这个方法时,我有一个错误:

System.IO.FileNotFoundException :“不可能的充电器和组装”System.Security.Cryptography.Algorithms,Version=4.3.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a‘ou une de ses .……“

内部例外:FileNotFoundException:System.Security.Cryptography.Algorithms,Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a‘ou une de ses .可供参考。

Nuget包System.Security.Cryptography.Algorithms版本4.3.1在我的项目中引用,在我的web.config中有:

代码语言:javascript
复制
  <dependentAssembly>
    <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
  </dependentAssembly>

你有办法帮我吗?非常感谢!

查莉

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-09-07 05:56:29

为了解决我的问题,我删除了web.config中的web.config块。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73580978

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档