简体   繁体   中英

Project References in Visual Studio suddenly not working on a workstation

I've got a solution with several references, but some of them stopped working when I opened Visual Studio today. The build error I get is:

Reference required to assembly 'ReferenceName, Version=X.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXX, Retargetable=Yes' containing the type 'ReferenceType'. Add one to your project.

I checked the properties of the affected references, and the values for descriptions and local filepaths became blank. Furthermore, these were .NET references, but were treated as COM references.

I tried to remove and add the references back, but one of the references gets a visual studio error message saying

a reference "Reference.ocx" can't be added, Please make sure that the file is accessible and that it is a valid assembly or COM component.

Another issue I have is that the re-added references do not get re-added the same way as the original references. They now include the "Interop" in their filenames in their reference names , whereas before the Interop was excluded. The added references can compile, but it still doesn't seem to be working properly.

The thing is, I have several versions of the same solution. When I load earlier and older versions of it into Visual Studio, the exact same reference problems surface. But on other machines with Visual Studio, the loaded projects build and compile just fine. So it seems to be something that happened specifically to my workstation that is causing my issues. And I also have another solution that I can compile, but doesn't work properly in that its reference calls gets exceptions.

I've searched for and tried every suggestion related to my error messages I've come across on forums with no success. Is there a reference cache causing these issues?

通过在Visual Studio中重新注册特定的引用,解决了该问题。

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