How to Disable .Net Strong Name Verification for All .Net assembly in system by config .net framework or IIS or project's config?
Try add it in regestry:
OS x32:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,af24b530b87e22f1]
OS x64:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,af24b530b87e22f1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,af24b530b87e22f1]
and add it to your Web.config:
<system.web>
<hostingEnvironment shadowCopyBinAssemblies="false" />
</system.web>
Web.config
change is an important step that the other answers I'd tried missed—thanks for calling it out. –
Assizes To disable strong name validation for all assemblies on your machine you can run:
sn.exe -Vr *
from a Developer Command Prompt for VS201*
This is an exception I received:
Error Type: System.IO.FileLoadException
Error Message: Could not load file or assembly 'MyAssemblyName, Version=5.1.0.0, Culture=neutral, PublicKeyToken=30b439e30eee46b4' or one of its dependencies.
Strong name validation failed. (Exception from HRESULT: 0x8013141A)
This is a solution which worked for me to disable strong name validation for a particular assembly while testing it within totally signed service:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\MyAssemblyName,30b439e30eee46b4]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\MyAssemblyName,30b439e30eee46b4]
You have to create those new keys in the registry, keys have no values under them. You can copy these two lines into .reg file, change assembly name and its guid and double-click it to merge into the Registry.
Note: assembly name is your filename without .dll extension, exactly as it shows in the exception.
Then restart your app/service.
I think the answers above with * instead of assembly name should also work.
Below Entries will work:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\StrongName\Verification\*,af24b530b87e22f1]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\StrongName\Verification\*,af24b530b87e22f1]
© 2022 - 2024 — McMap. All rights reserved.