Update DLL reference

雨燕双飞 提交于 2020-01-22 13:08:06

问题


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!


回答1:


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.




回答2:


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:




回答3:


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




回答4:


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




回答5:


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



来源:https://stackoverflow.com/questions/17145570/update-dll-reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!