为什么我不能引用我的类库? [英] Why can't I reference my class library?

查看:153
本文介绍了为什么我不能引用我的类库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含一个网站,并在Visual Studio 2008的类库的解决方案

I have a solution that contains a website and a class library in Visual Studio 2008.

然后我有一个需要引用类库的解决方案之外的另一个网站项目。我右键单击Bin文件夹或项目,然后选择添加引用,然后选择我的类库项目,它增加了15个左右的DLL类库需要到网站bin文件夹,但没有任何的.cs文件承认using语句。

I then have another web site project outside of the solution that needs to reference the class library. I right click the Bin folder or Project and select Add Reference, then select my Class Library Project, it adds the 15 or so DLLs that the class library needs to the websites bin folder, but none of the .cs files recognize the using statements.

using MyLibrary.MyFolder;

它说,它不能解析它,ReSharper的只是说,它可以安全地删除,因为它没有被使用。

It says that it can't resolve it, and ReSharper just says it can be safely removed since it's not being used.

ReSharper的可以识别它需要的参考,表明它的参考在MyLibrary并使用MyFolder中。我不知道为什么它提示我添加一个引用我已经有了。当我建议去了,我得到的错误

ReSharper can recognize that it needs the reference and suggests that it "Reference MyLibrary and use MyFolder". I'm not sure why it's suggesting I add a reference I already have. When I go with the suggestion, I get the error

无法参考模块。也许,引用会产生项目之间的循环依赖。

"Failed to reference module. Probably, reference will produce circular dependencies between projects."

我试着去网站属性页,并删除所有引用,并重新加入他们,但它给出了同样的错误。任何想法,为什么这不工作?

I've tried going to the websites property pages and removing all the references and re-adding them, but it gives the same errors. Any ideas why this isn't working?

推荐答案

我发现如何解决这个问题(至少对我来说)。为什么它的工作,我不知道,但它没有。 (我只是想针对也有同样的问题,第二个网站及以下解决方案为,作为好)。

I found how to fix this issue (for me at least). Why it worked, I'm not sure, but it did. (I just tried against a second website that was having the same problem and the following solution worked for that as well).

我试过项目和重建的正常清洗,关闭所有我的Visual Studio实例,并重新启动它们,甚至试图重新启动我的电脑。

I tried the normal cleaning of the projects and rebuilding, shutting down all my Visual Studio instances and restarting them, even tried restarting my computer.

什么实际工作是开放在Visual Studio项目中,关闭所有打开的标签,然后将其关闭。

What actually worked was opening up the project in Visual Studio, closing all the open tabs, and then shutting it down.

在我离开的选项卡中打开,因为我认为这并不重要(我几乎没有关闭,我使用的选项卡)。

Before I had left the tabs open because I didn't think it mattered (and I hardly ever close the tabs I'm using).

这篇关于为什么我不能引用我的类库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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