Reputation: 2437
I downloaded a new version of a third-party dll, copied it to a "Library" folder in a new project, and added a reference. I expect it to show version 5.0.6 in Reference Manager, but it shows 4.5.0.
I have version 4.5.0 on my system, but not anywhere else in the solution or in GAC. It seems to use 4.5.0 at runtime, but copies 5.0.6 to /bin
.
Please help me understand what is happening. I provided some supporting details below.
Update: I included a screenshot of reference properties per request.
dll properties:
Adding reference by browsing to file location:
And here is the resulting reference:
Properties:
If I display the Assembly version at runtime, it shows 4.5:
But when I look in /bin
, it has version 5.0.6.
Upvotes: 3
Views: 2940
Reputation: 69372
What you're looking at (5.0.6.16206) is the File Version
, not the Assembly Version
. The File Version is used by the file system and not by the .NET runtime. The assembly version is 4.5.0.0 and so what you're seeing is correct, and expected, information.
As Phillip mentioned in the comments, you should look into using NuGet as it makes things a lot easier.
Upvotes: 5
Reputation: 2738
Instead of using Assembly.Load
you should try using LoadFrom
instead. Then you won't be depending on it locating the Assembly for you from it's search path.
Upvotes: 0