简体   繁体   English

添加添加服务参考项目参考时

[英]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.

相关问题 将引用添加到项目时的事件 - Event when a reference is added to a project 尝试将Web服务引用添加到项目时的HTTP状态400 - HTTP status 400 when trying to add web service reference to a project 为什么已经从另一个项目添加了此引用,为什么还要添加相同的引用 - Why I need to add same reference when this reference had been added from another project 在Visual Studio 2010中使用“添加Web引用”添加服务时,如何访问服务方法? - How to Access the Service method when service is added using “Add Web Reference” in Visual Studio 2010? 无法将服务引用添加到移动服务项目 - Unable to add a service reference to a mobile service project WCF Visual Studio 2022 中的服务引用不包括项目引用 - WCF Service Reference in Visual Studio 2022 does not include project references 当它似乎被添加到项目时,引用丢失的错误 - Error that reference is missing when it seems to be added to project 使用“ Reference3接口”向项目添加所需的引用 - using “Reference3 Interface” to add desired references to a project 我可以创建动态 web 服务客户端引用而不将其引用添加到项目的服务引用中吗? - Can I create dynamic web service client reference without adding its reference to service references of the project? 如何在 .NET Standard 项目中“添加服务引用” - How to “Add Service Reference” in .NET Standard project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM