我正在网站.NET框架4.7.2工作,我想使用CSharpScript库。我安装了Microsoft.CodeAnalysis.CSharp.Scripting 4.3.0,并在控制器中创建了方法:
// 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中有:
<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>你有办法帮我吗?非常感谢!
查莉
发布于 2022-09-07 05:56:29
为了解决我的问题,我删除了web.config中的web.config块。
https://stackoverflow.com/questions/73580978
复制相似问题