在其他项目中使用类库的dll [英] Using dll of class library in other project

查看:87
本文介绍了在其他项目中使用类库的dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经通过添加引用添加了dll,并使用了derective,但仍然给我错误找不到类型或名称空间名称" SSCommuniLib"(您是否缺少using指令或程序集引用? ?)我正在Windows服务中使用类库.

我多次删除并添加了dll,但仍然无法正常运行.

警告1无法解析引用的程序集"SSCommuniLib,版本= 1.0.0.0,区域性=中性,processorArchitecture = MSIL",因为它依赖于"System.Web,版本= 4.0.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a ",它不在当前目标框架".NETFramework,Version = v4.0,Profile = Client"中. LeadsolarService

I have added the dll by adding reference as well as used using derective but still it is giving me error "The type or namespace name ''SSCommuniLib'' could not be found (are you missing a using directive or an assembly reference?)" I am using a class library in my windows service .

I removed and added the dll several times but still it is not working.

Warning 1 The referenced assembly "SSCommuniLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has a dependency on "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not in the currently targeted framework ".NETFramework,Version=v4.0,Profile=Client". LeadsolarService

推荐答案

您可以尝试将项目(类库和主项目)的.NetFramework版本都更改为4吗? .您可能需要添加System.web以使您的类库可行.

转到项目"->应用程序"->目标框架"的属性.
Can you please try to change the .NetFramework version to 4 for both the project(the class library,and the main project). You might need to add System.web to make workable of your class library.

Go to the Properties of the Project->Application->Target Framework.


这篇关于在其他项目中使用类库的dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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