在Visual Studio 2008中使用特定版本的参考版本、Visual、Studio

2023-09-03 03:11:28 作者:浅歌唱出悲伤

我有一个程序集,美孚,它引用了装配杆(XXX2000版)。 在属性,特定版本设置为False。 我在当地的 GAC 兼得吧(xxx2000)和律师(xxx1000)。 一切都很好。

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.

在另一台机器,如果没有版本的酒吧是在GAC中,但酒吧(xxx1000)位于同一目录中富,富运行将失败,声称它无法找到巴尔(xxx2000)与

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

无法加载文件或程序集酒吧,版本= xxx2000,   文化=中性公钥= YXYXYXYXXYX或它的一个   依赖性。找到的程序集清单定义不匹配   集引用。 (从HRESULT异常:0x80131040)

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)

应该不是富用吧(xxx1000)由于特定版本设置为False还是我失去了一些东西?

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.

修改

进一步阅读:http://www.$c$c-magazine.com/article.aspx?quickid=0507041&page=3

推荐答案

特定版本是一个构建时属性定向使用现有版本的编译器。在运行时,该框架看起来还是供大会被使用在构建时的特定版本。

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

请参阅本论坛讨论: http://forums.asp.net/t/1251728.aspx

 
精彩推荐