繁体   English   中英

加载程序集时出现异常:System.IO.FileNotFoundException:无法加载程序集“System.ValueTuple,版本 = 4.0.2.0,

[英]Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'System.ValueTuple, Version=4.0.2.0,

我尝试使用 Microchart 将图表包含到我的 xamarin 表单应用程序中,并且在安装 Microchart 和 Microchart.forms 块时,我无法再次构建我的项目,它给出以下错误

严重性代码描述项目文件行抑制状态错误在加载程序集时出现异常:System.IO.FileNotFoundException:无法加载程序集“System.ValueTuple,版本=4.0.2.0,Culture=neutral,PublicKeyToken=cc7b13ffcd2ddd51”。 也许它不存在于 Mono for Android 配置文件中? 文件名:'System.ValueTuple.dll' at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters) at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1 assembly,AssemblyBooleantopLevel assembly, ) 在 Xamarin.Android.Tasks.ResolveAssemblies.Execute() Xceed365m4.Droid C:\\Program Files (x86)\\MSBuild\\Xamarin\\Android\\Xamarin.Android.Common.targets 1410
00

我安装了 System.ValueTuple, Version=4.4。 请问我该如何解决这个问题?

我猜您使用的是 .net 框架版本 4.7。这是一个错误,有关更多信息,参阅https://github.com/dotnet/standard/issues/476

解决方法是在 app.config 中使用绑定重定向。

 <dependentAssembly>
        <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.4.0.0"/>
      </dependentAssembly>

如果没有,请尝试从您的解决方案中手动添加引用。 从 nuget 手动下载 System.ValueTuple 并从您的解决方案中引用此 dll。

右键单击 References 文件夹 -> 添加引用 -> 浏览位置 -> 添加。 清洁和建造。

我正在使用 Xamarin.Forms netstandard2.0 在 Windows 上工作,在添加项目引用后出现了一些类似的错误。

我的解决方案是...将参考“System.Configuration.dll”(..Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\System.Configuration.dll)添加到.Net Standard项目中。

我有一个类似的错误,结果我的机器上运行了一些僵尸构建进程。 在没有打开 Visual Studio 的情况下运行了三个 MSBuild.exe。 手动杀死它们,错误消失了。

经过多次搜索,我的解决方案是更新我系统上的 .Net 框架

我通过在web config添加以下行来修复

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  https://go.microsoft.com/fwlink/?LinkId=301880
  -->
<configuration>
    ..........
    <runtime>
        ...........
        <dependentAssembly>
            <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
      </dependentAssembly>
    </runtime>        

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM