[英]When add service reference project references are added
We got a problem when add a webservice reference to a project with Visual Studio option "Add Service reference". 使用Visual Studio选项“添加服务引用”将Web服务引用添加到项目时,我们遇到问题。 When the generation of client of web service is ended, two or three references to dll are added in project.
当Web服务的客户端生成结束时,在项目中添加了对dll的两个或三个引用。 The references to projects already exists, but Visual Studio add anothers to Dlls.
对项目的引用已经存在,但是Visual Studio向Dll添加了另一个。
If the developers don't remove this references, many times exists compilation problems or very rare issues when the application runs. 如果开发人员不删除此引用,则在应用程序运行时很多时候会存在编译问题或非常罕见的问题。 Exists some ways for auto delete this references when the code generation is ended?
存在一些在代码生成结束时自动删除此引用的方法吗? I think this references are needed for svcutil for "reuse types" option but not sense remains when webservice client has finalize generation.
我认为svcutil的“重用类型”选项需要此引用,但是当Web服务客户端完成生成时,仍然没有意义。
Most likely, the reference of the DLL(s) you have in your project has a different version from the one used in the WebService. 您项目中具有的DLL的引用很可能与WebService中使用的DLL具有不同的版本。 That's why a second reference is automatically added.
因此,会自动添加第二个引用。
The project won't compile at this point due to the ambiguous namespaces/methods in the different versions of the same DLL. 由于同一DLL的不同版本中的命名空间/方法不明确,因此该项目目前无法编译。 Removing one of the references is not a solution of the problem.
删除引用之一不是解决问题的方法。
You should use the same DLL version in your project and in the WebService. 您应该在项目和WebService中使用相同的DLL版本。
Also, this article might be useful as guidelines on how to manage project references. 此外, 该文章可能是因为对如何管理项目的参考指南有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.