简体   繁体   English

无法在Windows服务中引用dll

[英]Cannot reference dll in windows service

I've created a windows service in VS 2010 which references the model conveniently placed in a separate project which compiles to a dll. 我在VS 2010中创建了Windows服务,该服务引用了方便地放置在编译为dll的单独项目中的模型。 I have no problem referencing this dll in other parts of my solution (web apps), but in my windows services the following symptoms display: 我在解决方案的其他部分(Web应用程序)中引用此dll时没有问题,但是在Windows服务中,显示以下症状:

  1. Compiler error: The type or namespace %%% cannot be found (are you missing.... 编译器错误:找不到类型或名称空间%%%(您是否丢失...。
  2. I add a reference to %%% (directly to a dll copy or to the project, makes no difference). 我添加了对%%%的引用(直接引用到dll副本或项目中,没有区别)。
  3. The compile error dissapears. 编译错误消失了。
  4. I build. 我建立。
  5. The compile error reappears. 再次出现编译错误。

Using fw4. 使用fw4。

What's up with that? 那是怎么回事?

Edit: I can add and use other dlls ofcourse. 编辑:我可以添加和使用课程的其他dll。 Third party and microsoft's. 第三方和微软。

清除已创建的Debug&Release文件夹,然后尝试执行完整的“ Rebuild”

Always check your warning messages. 始终检查您的警告消息。

System.Web.Extensions Assembly cannot be resolved System.Web.Extensions程序集无法解析

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM