WebService 不会通过 ServiceReference 更新
我的 Visual Studio 解决方案中有两个项目:一个是 WcfService 应用程序项目,另一个是带有 ServiceReference 的普通 C# Silverlight 项目 > 在本地访问 Web 服务。
基本上一切正常,除了 Web 服务中的更改在我的 SL 项目中不可见:
例如,如果我修改某些属性在服务的 [DataContract] 类中'界面,两个项目都编译良好,但是当访问 SL 项目中的 Web 服务时,我只有修改前的状态。
在 VisualStudios ObjectBrowser 中查看 ServiceReference 会得到相同的结果:未经修改的我的 Web 服务。
我通过内置的自动“添加服务引用”将 ServiceReference 添加到了 SL 项目 em> 函数。每次修改 Web 服务时,我都会在 SL 项目中的服务参考上单击“更新服务参考”,该操作成功但没有效果。 即使删除服务引用并再次添加也不会向我显示具有已更改属性的 Web 服务。
也许是因为我几天前重命名了服务项目 - 我从解决方案中卸载了服务项目,重命名了文件系统中的文件夹,并将其作为“现有项目”再次添加到解决方案中。然后我重命名了服务文件(.svc & .svc.cs)和服务接口文件。 ==>之后,除了我无法识别的修改之外,一切似乎都工作正常?!此外,当向此服务添加 ServiceReference 时,我看到我重命名的两个文件的旧名称,而不是新名称!?
有谁知道这里发生了什么事吗? 预先感谢您阅读这个长问题;)
I have two projects in my Visual Studio solution: The one is a WcfService Application project and the other one is an ordinary C# Silverlight project with a ServiceReference to access the Web Service locally.
Basically everything works fine except the fact that changes in my Web Service are not visible in my SL project:
If i for example modify some attribute in a [DataContract] class of the service' interface, both projects compile well but the when accessing the web service in the SL project i only have the state before the modification.
Viewing the ServiceReference in the VisualStudios ObjectBrowser gives me the same result: My Web Service without modification.
I added the ServiceReference to the SL project via the in-built automatic "Add Service Reference" function. Everytime i modify the web service i click "Update Service Reference" on the Service Reference in the SL project which succeeds but without effect. Even a removal of the Service Reference and adding it again doesn't show me the web service with the altered attribute.
Maybe it's because i renamed the Service Project a few days ago - I unloaded the service project from the solution, renamed the folders in the file system and added it again as an "existing project" to the solution. Then i renamed the service file (.svc & .svc.cs) and the service interface file. ==> After that everything seems to work still fine except my unrecognized modifications ?! Also when adding a ServiceReference to this service I see the old names of the two files i renamed not the new ones !?
Does anyone has a clue what's going on here ?
Thank you in advance for reading this long question ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决问题的一种方法(好吧,这可能不是最好的解决方案,甚至可能是最糟糕的解决方案,但我确信它会起作用)是进行一系列清理:
目录)
文件中的“服务引用”)
当前的 WcfService 项目,您已
好吧,这样做会浪费一些时间,但它会起作用。
One way to solve your problem (OK, it's probably not the best solution, even probably the worst one, but I'm sure it'll work) is to do a bunch of cleanup:
directory)
"Service References" in the file)
current WcfService project you have
Okay, you'll lose some time doing this, but it'll work.