.NET 中完全限定的类型解析

发布于 2024-09-09 11:10:39 字数 546 浏览 3 评论 0原文

简单的问题(在 SharePoint 2010 中出现,但这并不真正相关)。

如何:

<add name="LdapMembershipProvider" type="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" 

...仅在 Microsoft.Office.Server.UserProfiles 程序集中找到实际类型 (LdapMembershipProvider),而不是在 Microsoft. Office.Server 组件?

两者均已在 GAC 注册。

即使指定了完全限定类型,Fusion 也会探测其他程序集吗?

Simple question (comes up in SharePoint 2010, but that's not really relevant).

How does:

<add name="LdapMembershipProvider" type="Microsoft.Office.Server.Security.LdapMembershipProvider, Microsoft.Office.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" 

...resolve when the actual type (LdapMembershipProvider) is only found in the Microsoft.Office.Server.UserProfiles assembly and not in the Microsoft.Office.Server assembly?

Both are GAC registered.

Does Fusion probe other assemblies, even when a fully qualified type is specified?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你的呼吸 2024-09-16 11:10:40

程序集绑定重定向?

MSDN - 程序集绑定重定向

您可以重定向程序集绑定
参考另一个版本
通过使用中的条目进行汇编
应用程序或机器配置
文件。您可以将引用重定向到
.NET Framework 程序集,第三方
程序集,或您自己的程序集
应用程序。

Assembly binding redirection?

MSDN - Assembly Binding Redirection ?

You can redirect an assembly binding
reference to another version of an
assembly by using entries in the
application or machine configuration
files. You can redirect references to
.NET Framework assemblies, third-party
assemblies, or assemblies of your own
application.

梦屿孤独相伴 2024-09-16 11:10:40

公钥令牌是否有可能实际上指向正确的程序集并且忽略程序集名称?

我正在阅读以下 MSDN 参考:

http://msdn。 microsoft.com/en-us/library/system.reflection. assemblyname.aspx

听起来可疑的摘录:

可以指定公钥
和一个不一致的密钥对
价值观。这可以用于
开发者场景。在这种情况下,
使用 GetPublicKey 检索公钥
指定正确的公钥,
而 KeyPair 指定了公共
以及期间使用的私钥
发展。 当运行时检测到
密钥对和密钥对之间不匹配
公钥,它在
注册匹配的正确密钥
公钥。

不确定。立即浮现在脑海中但我无法确认的一种行为是,如果它无法在配置中指定的程序集中找到类型,它会尝试通过项目引用找到它。

Is it possible that the public key token is actually pointing to the correct assembly and its ignoring the assembly name?

I was reading the following MSDN reference:

http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.aspx

The excerpt that sounds suspicious:

It is possible to specify a public key
and a KeyPair with inconsistent
values. This can be useful in
developer scenarios. In this case, the
public key retrieved with GetPublicKey
specifies the correct public key,
while the KeyPair specifies the public
and private keys used during
development. When the runtime detects
a mismatch between the KeyPair and the
public key, it looks up in the
registry the correct key that matches
the public key.

Not sure. One behaviour that immediately springs to mind, but I cannot confirm is that if it fails to find the type in the assembly you specify in configuration, it tries to find it through your project references.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文