添加对程序集的引用 [英] add reference to assembly

查看:256
本文介绍了添加对程序集的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好:

我目前正在Visual Studio 2008中开发两个解决方案,第一个是Web服务项目(WebService),第二个是WCF项目(WcfClient),在这里我将调用第一个方法. 我将第一个项目的库参考添加到第二个项目.

我的问题是当我拨打电话时,它向我显示此错误消息:

错误1在未引用的程序集中定义了类型"System.Web.Services.WebService".您必须添加对程序集"System.Web.Services的引用,版本= 2.0.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a.C:\ Documents and Settings \ Administrator \ My Documents \ Visual Studio 2008 \ Projects \ WcfLayer \ WcfClient \ client.c 18 13 WcfClient


请heeeeeeeeeeeeeeeelp. :((:((:((:((

Hi:

I am currently developing in Visual Studio 2008 two solutions,the first is a web service project (WebService) and the second is a WCF project (WcfClient) where I will make call to the methods of the first one.
I added the Library reference of the first project to the second.

My problem is that when I made the call, it show me this error message:

Error 1 Type ''System.Web.Services.WebService "is defined in an assembly that is not referenced. You must add a reference to assembly ''System.Web.Services, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a. C: \ Documents and Settings \ Administrator \ My Documents \ Visual Studio 2008 \ Projects \ WcfLayer \ WcfClient \ client.c 18 13 WcfClient


Please heeeeeeeeeeeeeeeelp. :(( :(( :(( :((

knowing that i''m begginer.

推荐答案

非常感谢,当我在我的引用中添加"System.Web.Services"时,问题就解决了WCF项目. :rose::):rose:
Thank you very much, the problem was solved when i just add "System.Web.Services" to the references of my WCF project. :rose: :) :rose:


您需要将System.Web.Services.WebService添加到WCF项目的引用中.就是这样,不需要任何using语句或类似的内容.

发生的情况是,您的WCF项目引用了WebService项目,并且您已经通过将其添加到引用中而告诉它(WCF)在何处找到它(WebService).但是,您的WebService使用Services.WebService,并且WCF项目不知道如何找到它,因此会抱怨.添加引用可以告诉WCF项目在哪里.
You need to add System.Web.Services.WebService to the references of your WCF project. That''s it, no need for any using statements or anything like that.

What is happening is that your WCF project references your WebService project and you''ve told it (WCF) where to find it (WebService) by adding it to the references. However your WebService uses the Services.WebService and the WCF project doesn''t know how to find it so it complains. Adding a reference tells your WCF project where to look.


您无需在客户端中添加服务的库引用.
实际上,您实际上需要将服务作为服务引用"添加到客户端.
You don''t need to add a library reference of your service in the client.
You actually need to add your service as "a service reference" to the client.


这篇关于添加对程序集的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆