Logic Speak Blogs
Search Minimize
 
Jun 20

Written by: Scott Percy
Friday, June 20, 2008 12:14 PM

As Gordon and I were working on a project together, we noticed that the version of an assembly we had set up was not the one that was being used in the application.  We use a number of third party assemblies and controls, so keeping track of a specific version is crucial (especially, when that assembly references specific versions of other assemblies).  Apparently, when you set up a reference to an assembly by selecting a file on your file system, Visual Studio may not choose that file when building.  Actually, it only looks for that file based on the path as a second to last resort (the last being looking in the GAC).  In fact, if you look at the properties of a referenced assembly, you'll see the "Path", but if you look at the XML of the project file, the property is called "HintPath".  So, it's basically saying, "if you really can't find this file anywhere else, look here" instead of (what I thought it meant) "this is exactly where the file is".  I found this article which talks about the issue, and what the resolution is:

http://blogs.msdn.com/irenak/archive/2005/12/13/503105.aspx

Basically, for any file referenced assembly, you should be sure to change the "Specific Version" value to true, because it defaults to false.  That way, you are assured that you will be including the proper verion in your builds.  The good thing is that once this value is set, the version that it looks for is the actual version of the file.  So, in our case, we have a "Dependancies" or "References"  folder in our solutions.  If we simply update the assembly in that folder, it works like a charm. 

Just some bit of "wonky-ness" to note.  Until next time...

Tags:

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment    Cancel