在其他项目中使用类库的dll

编程入门 行业动态 更新时间:2024-10-26 19:26:07
本文介绍了在其他项目中使用类库的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

本文发布于:2023-07-16 16:08:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1123414.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:类库   项目   dll

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!