简体   繁体   English

VS2015编译器将忽略对我的DLL的所有引用

[英]VS2015 Compiler ignores all references to my DLLs

I'm working on VS2015 Update 1 on Windows 10 我正在Windows 10上的VS2015 Update 1上工作

I'm writing here because after 4 hours I am totally lost... 我在这里写信是因为4小时后我完全迷路了...

Today I've launched the rebuild of my base libraries solution, it is the oldest of my projects and it has been correctly compiled last week. 今天,我启动了我的基础库解决方案的重建,它是我的最老项目,并且上周已正确编译。

But today, for all projects that reference one or more of my other dlls the compiler gives a CS0234 or a CS0246 error. 但是今天,对于所有引用一个或多个其他dll的项目,编译器都会给出CS0234或CS0246错误。 As if the referenced DLL wasn't in the place where it is referenced or it was unreadable... and I can't understand why... 好像所引用的DLL不在所引用的DLL中,或者它不可读...而且我不明白为什么...

The Solution contains several projects, the Build order is correct (because the build machine on my TFS builds them correctly) 解决方案包含几个项目,构建顺序正确(因为我的TFS上的构建计算机正确构建了它们)

Every project after building its DLL publishes it on a folder B:\\CommonDll the references are all done on this folder. 构建了DLL的每个项目都将其发布在文件夹B:\\ CommonDll上,所有引用均在此文件夹上完成。 Using the Add Reference, Browse, opening the B:\\commondll folder and adding it to the project. 使用“添加引用”,浏览,打开B:\\ commondll文件夹并将其添加到项目中。

Today, the compiler decided that all these dlls are inexistent, they are not copied on the bin\\debug folder and in result the CS0234 or CS0245 errors. 今天,编译器决定所有这些dll不存在,没有将它们复制到bin \\ debug文件夹中,从而导致CS0234或CS0245错误。

Since it seemed some permission problem, I've checked user permissions on the disk and on the folder, I've deleted and recreated the folder, I've deactivated the UAC, reset the PC several times run visual studio normally or as administrator, I've tried to use a folder on another disk and the error persists. 由于这似乎是一个权限问题,因此我检查了磁盘和文件夹上的用户权限,删除并重新创建了文件夹,停用了UAC,重置了PC几次,以正常方式或以管理员身份运行Visual Studio,我试图使用另一个磁盘上的文件夹,错误仍然存​​在。 I've made a scandisk, a checkdisk, a clean disk reapplied the user permission on all files and folders and objects. 我已经制作了一个扫描磁盘,一个检查磁盘,一个干净的磁盘,重新对所有文件,文件夹和对象应用了用户权限。 I've deleted the bin and obj folders of the projects before compiling. 在编译之前,我已经删除了项目的bin和obj文件夹。

The only test that works is to directly reference the libraries through the project, but I don't intend to apply it because it is completely impractical for the use of all these libraries. 唯一有效的测试是直接通过项目引用这些库,但我不打算应用它,因为使用所有这些库完全不切实际。

If you have any clue on what else i can try I would be eternally grateful... 如果您对我还能尝试的其他方法有任何了解,我将永远感激不已。

I don't have a copy of VS2015 in front of me, but I know that references in VS2013 and earlier used a hint path in the project file that would sometimes get very wonky. 我前面没有VS2015的副本,但我知道VS2013和更早版本中的引用在项目文件中使用了提示路径 ,有时可能会变得很不稳定。 These are relative paths to the assembly, and sometimes, were just all kinds of strange. 这些是组装的相对路径,有时只是种种奇怪的现象。

Try opening the .CSPROJ or .VBPROJ file in a plain text editor, such as Notepad or Notepad++ and look for a <HintPath> element. 尝试在纯文本编辑器(例如Notepad或Notepad ++)中打开.CSPROJ或.VBPROJ文件,然后查找<HintPath>元素。 This should be a relative path to the assembly you're trying to reference. 这应该是您要引用的程序集的相对路径。 If it looks strange to you, it may be a source of confusion. 如果您觉得它很奇怪,可能会引起混乱。

A word of advice 忠告

You're referencing assemblies from a folder that may be outside of your solution root. 您从解决方案根目录之外的文件夹中引用程序集。 That's generally not a good idea, unless those assemblies are in the GAC. 除非这些程序集在GAC中,否则通常不是一个好主意。 Move that folder so that it's under the solution root folder, and reference them from there. 移动该文件夹,使其位于解决方案根文件夹下,然后从那里引用它们。

Things should go more smoothly then. 事情应该会更加顺利。

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

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