Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a .NET Core xUnit project. I'm trying to call a WCF service from it but get the following exception:

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.

It works with a Framework 4.7 project with the same Nuget Package System.ServiceModel.Http.4.3.0.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
632 views
Welcome To Ask or Share your Answers For Others

1 Answer

Microsoft has made available the relevant assemblies as packages on NuGet now.

System.ServiceModel.Primitives is the base package; add the others if necessary to your project.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...