且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更新服务参考导致参数类型不匹配

更新时间:2023-10-29 19:44:52

第一个问题是我的枚举类型被同时引用为WebServiceName.EnumeratedType.和XBAPName.EnumeratedType.做完一些研究后,我尝试右键单击ServiceReference->配置服务参考->在引用的程序集中重用类型,并确保已选中此选项. las,这不能解决我的问题.
The first problem is that my enumerated type is being reffered to both as WebServiceName.EnumeratedType and XBAPName.EnumeratedType. After doing some research I tried right-clicking the ServiceReference -> Configure Service Reference -> Reuse Types in Referenced Assemblies and ensured this was checked. Alas, this didn't solve my problem.


这很奇怪.当您使用重用类型"时,甚至应该没有"XBAPName.EnumartedType".完全由服务配置工具创建.如果在其余的代码中使用了该类型,则现在应该得到一个"XBAPName.EnumartedType类型不存在".错误或类似的内容.一旦遇到该错误,就可以将类型更改为重用类型.是的,这可能意味着要进行大量查找/替换.


This is very odd. When you use "Reuse Type", there should not even be a "XBAPName.EnumartedType" created by the Service Configuration Tool at all. If you've used that type in the rest of your code, you should now be getting a "XBAPName.EnumartedType Type does not exist" error or something similar instead. Once you have that error, then you can change your types to the reused type. Yes, that may mean a whole lot of find/replaces.