使用 WCF 服务的 WPF Web (xbap) 引发 System.Net.webPermission 异常
我有一个 xbap 应用程序在本地计算机的 IIS 7.5 上以部分信任的方式运行。我将 WCF 服务发布到与 xbap 相同的目录。
在经历了一些困难之后,我可以让它通过 Visual Studio 工作以进行调试,但在发布后我似乎无法让它在 IIS 服务器上工作。
我在.Net 4.0上运行
错误内容: “请求 System.Net.webPermission 类型的权限,系统 Version=4.0.0.0,文化中立,PublicKeyToken=b77a5c56l934e089 失败。”
更新:
所以我重新开始,制作一个新的 Wcf 服务、新的 Xbap 和一个要部署到的新站点。在验证了每一步之后,我得到了它因此,我开始将以前的应用程序逐一集成到新站点,以找出问题所在,将其范围缩小到原来的 Wcf 服务,但在使其与工作应用程序相同后,它就出现了。仍然存在 WebPermission 错误,
因此,除了重做修复它之外,我仍然不知道是什么导致了该问题。
I have an xbap application running with partial trust on my local machine's IIS 7.5. I published the WCF service to the same directery as the xbap.
After jumping through some hoops I could get it working through Visual Studio for debugging perposes, but I can't seem to get it to work on an IIS server after it's published.
I'm running on .Net 4.0
Contents of the error:
"Request for the permission of type System.Net.webPermission, System
Version=4.0.0.0, culture neutral, PublicKeyToken=b77a5c56l934e089 failed."
Update:
So I started over, making a new Wcf service, new Xbap and a new site to deploy to. After verifying every step of the way, I got it to work. So I started to integrate my previous apps, one-by-one, over to the new site to discover what was the problem. I narrowed it down to my original Wcf service, but after making it identical to the working one, it still has the WebPermission error.
So, I still don't know what was causing the problem, other than redoing it fixed it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,查看 web.config 文件,我注意到我注释掉了以下行:
我取消注释它并且不再出现错误。
Well, looking through the web.config file I noticed that I had commented out the following line:
I uncommented it and no more error.