Strong Name Validation Failed on CRM 2016 GeneratePicklistEnums
<p>I am starting a new project on a new Windows 10 computer working on CRM 2016 and have some strange behavior. I needed to generate the enumerations of the picklists for my code so I used the GeneratePicklistEnums project from the 2016 SDK SampleCode folder. I created the signing certificate on the project properties, ran build, and modified the .bat file (as I have done with past versions) and when I run the batch file I get this error:</p>

<p>Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Strong name validation failed. (Exception from HRESULT: 0x8013141A) ---> System.Security.SecurityException: Strong name validation failed. (Exception from HRESULT: 0x8013141A)
   --- End of inner exception stack trace ---
   at Microsoft.Crm.Services.Utility.CrmSvcUtil.Main(String[] args)</p>

<p>I read a bunch of blogs and MS community posts on turning off strong name checking and adding exceptions - none of them worked. </p>

<p>I looked at the AssemblyInfo.cs and didn't see any reference to the AssemblyKeyFile so I added one - didn't make a difference. I tried several things with sn.exe, including "sn -Vr *" but that didn't work either. I used ildasm to inspect the GeneratePicklistEnums.dll and it showed as version 0.0.0.0 and all the referenced assemblies did have version numbers. </p>

<p>Any suggestions?</p>

<p>--- update:
I finally got the code to run by going back to the SDK and copying the following files from that BIN folder into my project BIN folder:</p>

<pre><code>Microsoft.Xrm.Tooling.Connector
Microsoft.IdentityModel.Clients.ActiveDirectory
Microsoft.Xrm.Tooling.CrmConnectControl
Microsoft.Crm.Sdk.Proxy
Microsoft.Xrm.Sdk
</code></pre>

<p>but it still is not getting a version or strong name. </p>