如何找到特定 dll 的 PublicKeyToken? [英] How do I find the PublicKeyToken for a particular dll?
本文介绍了如何找到特定 dll 的 PublicKeyToken?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在我的 web.config 文件中重新创建一个如下所示的提供程序:
I need to recreate a provider in my web.config file that looks something like this:
<membership defaultProvider="AspNetSqlMemProvider">
<providers>
<clear/>
<add connectionStringName="TRAQDBConnectionString" applicationName="TRAQ" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0"
name="AspNetSqlMemProvider"
type="System.Web.Security.SqlMembershipProvider, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"
/>
</providers>
</membership>
但是,我收到一个运行时错误,说这个程序集无法加载,我认为这是因为我有错误的 PublicKeyToken.如何查找我的程序集的 PublicKeyToken?
However, I get a runtime error saying this assembly cannot be loaded, and I think it is because I have the wrong PublicKeyToken. How do I look up the PublicKeyToken for my assembly?
或者,我这样做是否完全错误?
Alternatively, am I going entirely the wrong way with this?
推荐答案
使用PowerShell,可以执行这个语句:
Using PowerShell, you can execute this statement:
([system.reflection.assembly]::loadfile("C:..Full_Path..MyDLL.dll")).FullName
输出将提供 Version、Culture 和 PublicKeyToken,如下所示:
The output will provide the Version, Culture and PublicKeyToken as shown below:
MyDLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a
这篇关于如何找到特定 dll 的 PublicKeyToken?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文