简体   繁体   English

为什么在VS2010中添加服务引用时,是否生成了客户端类?

[英]Why, when adding a service reference in VS2010, is the client class not generated?

I'm going insane, I beleive. 我疯了,我相信。

That is, I've never had an issue like this before, and nobody (that Google has indexed) seems to be having the same issue. 也就是说,我以前从来没有遇到这样的问题,没有人(谷歌已经编入索引)似乎也遇到了同样的问题。

Whenever I add a reference to a particular ASMX service to a VS2010 project, all of the code is generated, there is an interface ServiceSoap that represents all of the features of the service, but there is no concrete implementation of that interface anywhere in the solution! 每当我向VS2010项目添加对特定ASMX服务的引用时,生成所有代码,就会有一个代表服务所有功能的接口ServiceSoap ,但解决方案中的任何地方都没有具体的实现!

What am I doing wrong? 我究竟做错了什么? I just right click project , add service reference , paste url to .asmx , type 'Blah' in the namespace box , click OK . 我只需right click projectadd service reference ,将paste url to .asmxtype 'Blah' in the namespace boxclick OK

Everything seems to happen OK. 一切似乎都好了。 I'm just bat-shit insane, I guess... 我猜蝙蝠疯了,我猜...


Update: 更新:
If I go to Advanced... in the add service reference dialog, and choose to add it as a .NET 2.0 service, everything works, but I don't particularly want to do it that way. 如果我在添加服务引用对话框中转到Advanced...并选择将其添加为.NET 2.0服务,一切正常,但我不是特别想这样做。
The actual namespace I'm using is Remedy and the service .asmx file is Service.asmx . 我使用的实际命名空间是Remedy ,服务.asmx文件是Service.asmx

Try this... 尝试这个...

right click on the service reference. 右键单击服务引用。 then go to configure service reference. 然后去配置服务参考。 then uncheck reuse types in referenced assemblies checkbox. 然后取消选中引用程序集中的重用类型复选框。 upd UPD

this solved mine, hope it will help somebody else too 这解决了我的希望,希望它也能帮助别人

Try these steps: 请尝试以下步骤:

  1. Look in the Output window to see if there are any errors when you use the "Add Service Reference". 在“输出”窗口中查看使用“添加服务引用”时是否存在任何错误。
  2. Look in the Reference.cs to see if there are any errors (generated as comments). 查看Reference.cs以查看是否存在任何错误(生成为注释)。
  3. Finally, try using svcutil.exe to generate the proxies, since it will be easier to see error messages. 最后,尝试使用svcutil.exe生成代理,因为它更容易看到错误消息。

Have you tried clicking "Show all files"? 您是否尝试过点击“显示所有文件”?

替代文字

With this feature on, the Service Reference can be expanded to its various "source" files. 启用此功能后,可以将服务引用扩展为其各种“源”文件。

While clicking "show all files" icon. 点击“显示所有文件”图标。 There is another folder which they hold the same name. 还有另一个文件夹,它们具有相同的名称。 while deleting the folder. 删除文件夹时。 and clean the solution. 并清理解决方案。 Add new services with the same name. 添加具有相同名称的新服务。 Now its working fine. 现在它的工作正常。

右键单击引用,然后 - “在对象浏览器中查看”只需双击对象资源管理器中的一个方法/属性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM