简体   繁体   中英

VS2015 Compiler ignores all references to my DLLs

I'm working on VS2015 Update 1 on Windows 10

I'm writing here because after 4 hours I am totally lost...

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. As if the referenced DLL wasn't in the place where it is referenced or it was unreadable... and I can't understand why...

The Solution contains several projects, the Build order is correct (because the build machine on my TFS builds them correctly)

Every project after building its DLL publishes it on a folder B:\\CommonDll the references are all done on this folder. Using the Add Reference, Browse, opening the B:\\commondll folder and adding it to the project.

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.

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. 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.

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. 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. 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. Move that folder so that it's under the solution root folder, and reference them from there.

Things should go more smoothly then.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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