简体   繁体   English

无法在C#中使用My Class库

[英]Not able to use My Class library in C#

I am using Visual Studio 2017. I have a solution and in that solution I have 2 projects. 我正在使用Visual Studio 2017.我有一个解决方案,在该解决方案中我有2个项目。 One project is a library I made. 一个项目是我制作的图书馆。 This library is using Target Framework .Net Standard 1.6 and Output type: Class Library. 该库使用Target Framework .Net Standard 1.6和输出类型:类库。 The other project is a Windows Application using Target Framework: .Net Framework 4.6.1 and output type: Windows Application. 另一个项目是使用Target Framework的Windows应用程序:.Net Framework 4.6.1和输出类型:Windows应用程序。

I added my class library to my windows application and the reference is in the Reference section, but when I try to use a class from the library, it cannot find it. 我将我的类库添加到我的Windows应用程序中,引用位于参考部分,但是当我尝试使用库中的类时,它找不到它。 Also I tried adding the "Using MyLibrary" and it still cannot find the reference. 此外,我尝试添加“使用MyLibrary”,它仍然无法找到参考。 What else can I do? 我还可以做些什么?

I'm not sure why but the whole solution must had been corrupted or something. 我不确定为什么,但整个解决方案必定已经损坏或其他东西。 So I remade a whole new solution and created the projects again and copied all my files over and it worked. 所以我重新制作了一个全新的解决方案并再次创建了项目,并复制了我的所有文件,并且工作正常。 Not sure what the whole problem was but it is now working. 不确定整个问题是什么,但它现在正在运作。

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

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