相关疑难解决方法(0)

在.NET Core项目中找不到System.ServiceModel

我有一个.NET Core xUnit项目.我正在尝试从它调用WCF服务,但得到以下异常:

System.InvalidOperationException occurred
  HResult=0x80131509
  Message=An error occurred while loading attribute 'ServiceContractAttribute' on type 'IMyContract'.  Please see InnerException for more details.

Inner Exception 1:
FileNotFoundException: Could not load file or assembly 'System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
Run Code Online (Sandbox Code Playgroud)

它适用于具有相同Nuget包的Framework 4.7项目System.ServiceModel.Http.4.3.0.

.net c# wcf .net-core

32
推荐指数
3
解决办法
3万
查看次数

标签 统计

.net ×1

.net-core ×1

c# ×1

wcf ×1