40

I wanted to update some DLLs used in my .NET project to the latest version and I've noticed that, if I replace the DLLs on the file system with their new versions, VS 2012 updates the DLL version number in the Properties window.

Is this some new feature of VS 2012? I don't remember seeing it in VS 2010 (I expected it would need more manual handling).

Is this working right, or should I remove and re-add the DLLs manually from the references, just to be sure?

Anyway, my project compiles and runs fine, so I guess it works...

EDIT:

I guess it works because the DLLs are not strongly named (http://msdn.microsoft.com/en-us/library/wd40t7ad.aspx)? Perhaps I should re-add them if they were... Inside the project file I saw it had the old version number, but in the properties window I saw the new one...

Thanks!

Ben Reich
  • 16,222
  • 2
  • 38
  • 59
user2173353
  • 4,316
  • 4
  • 47
  • 79
  • 6
    That down-vote means that my question isn't good? Should I ask questions only for code related stuff? What is it? You don't like my (hidden) face or sth? – user2173353 Jun 17 '13 at 12:04
  • You can check my answer related to that type of question. https://stackoverflow.com/questions/3944679/how-to-update-assembly-assembly-references-in-a-web-site/52762061#52762061 – Ghulam Kibria Oct 11 '18 at 14:09
  • You can check my answer on the same type of question. https://stackoverflow.com/questions/3944679/how-to-update-assembly-assembly-references-in-a-web-site/52762061#52762061 – Ghulam Kibria Oct 11 '18 at 14:11
  • I had this problem too and I did open/close dll properties window and It reloaded itself. – Majid Jul 07 '19 at 05:41
  • Related post - [.NET DLL references/dependency checking utility](https://stackoverflow.com/q/8750018/465053) – RBT Jan 14 '20 at 00:54

5 Answers5

44

Easier option to refresh / reload references & types DLL (for example COM interop types) without re-adding all DLLs one-by-one is to reload all projects that reference it like this:

enter image description here enter image description here

Evalds Urtans
  • 6,436
  • 1
  • 41
  • 31
  • 2
    Unfortuantely unloading and reloading doesn't appear to work in VS2015 at least (14.0.24720.00 Update 1) – fostandy Aug 29 '16 at 22:07
  • Right now I tried Unload and Reload of Project with external DLLs, that are not in the same solution. It works. VS 2015 Version is 14.0.25421.03 Update 3 – Arseniy Sep 02 '16 at 11:20
  • 1
    Did not work for me in VS2015 using COM references. But removing the COM DLL and re-adding did work. – StayOnTarget Dec 21 '16 at 21:17
24

It's better to remove and re-add your references. You said it yourself that the project file was not up-to-date.

I am not sure if there is an add-on for VS that could make updating DLLs easier. If there isn't one, definitely someone should make one. Changing assembly references in large projects is a pain in the @ss.

NoOne
  • 3,851
  • 1
  • 40
  • 47
  • How is removing and readding references not a hack? Is there some cleaner way? – Anders Lindén Sep 21 '14 at 10:47
  • 1
    @AndersLindén Well, if you are using NuGet you could update them all at once: http://blog.nuget.org/20121231/a-quick-tutorial-on-update-package-command.html. But for the rest of the cases I haven't found any alternative. The other answer below from Evalds Urtans is something I have never tried. But I don't understand why VS would update the DLL references on project reload. – NoOne Oct 06 '14 at 21:05
1

What worked for me is - go to 'manage nuget packages' and update all.

Devs love ZenUML
  • 11,344
  • 8
  • 53
  • 67
1

Managing references as NuGet packages is significantly easier. You can view which references became out of date and choose which to update. Downside: if you are not using the standard packages (available via NuGet.org) you have to manage your own NuGet repository.

You can manage your NuGet packages via GUI or console. NuGet packages manager GUI

0

better option is to de refrence the dll and refrence again but make sure for safety purpse you keep the backup of your previous dll...

Muhammad Saeed
  • 81
  • 3
  • 10