Mat*_*ius 2 c# wcf local .net-4.5 visual-studio-2013
我有工作Visual Studio 2013,.NET4.5.
最初我是WCF服务消费者,但由于缺乏处理子系统的团队资源,我接管了WCF服务双方的开发.所以我得到了我需要调用的WCF服务的代码,现在尝试将其插入以在我的本地系统上调试它.
问题:我需要调用的服务在localhost上工作正常我可以获取wsdl并浏览它.
但是,当我尝试Visual Studio 2013"配置服务引用..."并尝试将URL从开发服务器更改为本地时,它给了我Object reference is not set to an instance of an object错误.

有没有人经历类似的事情?是什么造成的?我如何解决它?
小智 5
我知道这有点晚了但我遇到了类似的问题,我通过在服务端点的app.config文件中添加一个identity元素来修复它.例:
<identity>
<userPrincipalName value="username@domain" />
</identity>
Run Code Online (Sandbox Code Playgroud)
对我而言,即使userPrincipalName为空值,它也能正常工作:
<identity>
<userPrincipalName value="" />
</identity>
Run Code Online (Sandbox Code Playgroud)
完整端点元素:
<endpoint address="net.tcp://localhost:9876/my-service/tcp" ... >
<identity>
<userPrincipalName value="" />
</identity>
</endpoint>
Run Code Online (Sandbox Code Playgroud)