Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of specific version reference in Visual Studio 2008

Tags:

I have an assembly, Foo, which has a reference to assembly Bar (version X.X.X.2000). In the properties, the specific version is set to False. I have both Bar (x.x.x.2000) and Bar (x.x.x.1000) in my local GAC. Everything is fine.

On another machine, where no version of Bar is in the GAC, but Bar (x.x.x.1000) is located in the same directory as Foo, running Foo will fail claiming it can not find Barr (x.x.x.2000) with

Could not load file or assembly 'Bar, Version=x.x.x.2000, Culture=neutral, PublicKeyToken=YXYXYXYXXYX' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Shouldn't Foo use Bar (x.x.x.1000) since the specific version is set to False or am I missing something?

Maybe I didn't get how specific version really works.

There are some other questions about specific version references on Stack Overflow but none of it was any help to me.

EDIT

further reading: http://www.code-magazine.com/article.aspx?quickid=0507041&page=3

like image 456
sloth Avatar asked Aug 05 '09 12:08

sloth


1 Answers

"Specific Version" is a build-time property directing the compiler to use the available version. At run-time, the framework still looks for the specific version of the assembly that was used at build time.

See this forum discussion: http://forums.asp.net/t/1251728.aspx

like image 101
DCNYAM Avatar answered Oct 16 '22 20:10

DCNYAM