Use of specific version reference in Visual Studio 2008

我是研究僧i 提交于 2019-12-03 23:53:18

问题


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


回答1:


"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



来源:https://stackoverflow.com/questions/1232842/use-of-specific-version-reference-in-visual-studio-2008

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