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>
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?
Will result in
Using sn.exe utility:
or loading the assembly in Reflector.
I use Windows Explorer, navigate to C:\Windows\assembly , find the one I need. From the Properties you can copy the PublicKeyToken.
This doesn't rely on Visual Studio or any other utilities being installed.
If you have the DLL added to your project, you can open the csproj file and see the Reference tag.
Example:
Just adding more info, I wasn't able to find sn.exe utility in the mentioned locations, in my case it was in C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin
Using PowerShell, you can execute this statement:
The output will provide the Version, Culture and PublicKeyToken as shown below: