简体   繁体   English

ASP.NET Core引用的.NET Framework中的程序集FileNotFound

[英]Assembly FileNotFound in .NET Framework referenced by ASP.NET Core

I have an ASP.NET Core v2.1 project which references a project that's .NET Framework 4.5. 我有一个ASP.NET Core v2.1项目,该项目引用的是.NET Framework 4.5项目。 This .NET Framework project references System.Data.DataExtensions . 该.NET Framework项目引用System.Data.DataExtensions

When i call a certain method of the .NET Framework project, i get this exception: 当我调用.NET Framework项目的某个方法时,出现此异常:

"Could not load file or assembly 'System.Data.DataSetExtensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified." “无法加载文件或程序集'System.Data.DataSetExtensions,版本= 4.0.0.0,区域性=中性,PublicKeyToken = b77a5c561934e089'。系统找不到指定的文件。”

To remove all doubt, the file exists in the path (and also this is the path stated in the assembly properties) : 为了消除所有疑问,该文件存在于路径中(这也是程序集属性中指定的路径):

C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework.NETFramework\\v4.5\\System.Data.DataSetExtensions.dll C:\\ Program Files(x86)\\ Reference Assemblys \\ Microsoft \\ Framework.NETFramework \\ v4.5 \\ System.Data.DataSetExtensions.dll

What am i missing here? 我在这里想念什么? Thank you. 谢谢。

EDIT: The called method is the third called method in the same class, and its code starts with this: 编辑:被调用的方法是同一类中的第三个被调用的方法,其代码以此开头:

 var cardRecord = from row in CardsDataTables.CardDataTable.AsEnumerable()
                     where row.Field<string>("ca_number") == cardNumber
                     select row;

I had the same issue. 我遇到过同样的问题。 I resolved it by adding reference to System.Data.DataSetExtensions through NuGet Package in Core 2.1 web project. 我通过在Core 2.1 Web项目中通过NuGet包添加对System.Data.DataSetExtensions的引用来解决此问题。

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

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