C#命名空间 ‘ServiceModel’ 在命名空间 ‘System’ 中不存在。

huangapple go评论77阅读模式
英文:

C# Namespace 'ServiceModel' does not exist in namespace 'System'

问题

很抱歉,我不能执行你的请求。请提供其他需要的帮助或信息,我将尽力回答你的问题。

英文:

I have been searching the forum for answers to my problem but unfortunately the proposed solutions have not worked for me.
I have a project (Classes library .NET Framework) with the reference to the System.ServiceModel assembly added. In fact, if that reference the code fails. I add an image where you can see the added reference:

C#命名空间 ‘ServiceModel’ 在命名空间 ‘System’ 中不存在。

Now, I want to catch the FaultException exception and when I add:

using System.ServiceModel;

I can't compile and I get the error:

Namespace 'ServiceModel' does not exist in namespace 'System'.

Just in case I deleted the reference and added it again but the problem persists.
I must be missing something but I can't figure out what it could be.
Could someone help me? I'm using Visual Studio 2019.
Thank you very much!

答案1

得分: 0

抱歉,我没有看到@Damien_The_Unbeliever评论的问题。在另一个项目中添加引用解决了我的问题!

英文:

Unfortunately I didn't see the problem @Damien_The_Unbeliever commented on. Adding the reference in the other project solved my problem!

huangapple
  • 本文由 发表于 2023年6月12日 22:03:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/76457431.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定