[英]Visual Studio 2015 can't find class library even though it builds
I'm trying to share a class library between an ASP.NET Core project and a Xamarin Forms project. 我正在尝试在ASP.NET Core项目和Xamarin Forms项目之间共享类库。 So far I managed to make the project compile and actually work, however I have a problem referencing my file in Visual Studio.
到目前为止,我设法使项目能够编译并可以正常工作,但是在Visual Studio中引用我的文件时遇到了问题。
As shown in the image below, it says it can't find the class library (even though there is a reference to it and it build/runs correctly!) 如下图所示,它说找不到类库(即使有对它的引用并且它可以正确地构建/运行!)
I found out that when I delete the classlibrary, and load the xproj file instead of the csproj file it works in the Asp.net core project, but then it doesn't work in xamarin anymore. 我发现,当我删除类库并加载xproj文件而不是csproj文件时,它可以在Asp.net核心项目中使用,但是后来在xamarin中不再可用。
Any way to make it work in both projects? 有什么办法可以使其在两个项目中都能正常工作?
Edit: This is the solution I am talking about: https://github.com/arnvanhoutte/Drivr 编辑:这是我正在谈论的解决方案: https : //github.com/arnvanhoutte/Drivr
Visual Studio has sometimes issues like this. Visual Studio有时会出现这样的问题。 If you have a issue like this, copy the content from the class which is not found, delete it, create a new file/class with the name of the old file/class and paste the content.
如果您遇到这样的问题,请从未找到的类中复制内容,将其删除,使用旧文件/类的名称创建一个新文件/类,然后粘贴该内容。 Save and your problem should be fixed.
保存,您的问题应该得到解决。
在project-> properties中设置类路径
原来的解决方案是删除.xproj文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.