Build error on UnitTest.dll

Topics: EF Runtime
Jan 22, 2013 at 3:42 PM

I get the following error in the output page of VS2012 ultimate
------ Discover test started ------
xUnit.net: Exception discovering tests from C:\Projects\Library\EF\test\EntityFramework\FunctionalTests\bin\Debug\EntityFramework.FunctionalTests.dll: System.IO.FileLoadException: Could not load file or assembly 'EntityFramework.FunctionalTests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Strong name signature could not be verified.  The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from HRESULT: 0x80131045)
File name: 'EntityFramework.FunctionalTests, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef)
   at Xunit.Sdk.Executor..ctor(String assemblyFilename)
   at Xunit.ExecutorWrapper.RethrowWithNoStackTraceLoss(Exception ex)
   at Xunit.ExecutorWrapper.CreateObject(String typeName, Object[] args)
   at Xunit.ExecutorWrapper..ctor(String assemblyFilename, String configFilename, Boolean shadowCopy)
   at Xunit.Runner.VisualStudio.VsTestRunner.DiscoverTests(IEnumerable`1 sources, IDiscoveryContext discoveryContext, IMessageLogger logger, ITestCaseDiscoverySink discoverySink)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

========== Discover test finished: 0 found (0:00:00,2820161) ==========

 

I have all the references ok.

Can you guide me to solve the problem?

Jan 22, 2013 at 5:10 PM
Edited Jan 23, 2013 at 5:47 PM

This "Strong name signature could not be verified" indicates that the strong name verification has not been turned off for this assembly. Did you run the SkipStrongName util (http://entityframework.codeplex.com/documentation Getting and Building code, step 4)?


Jan 23, 2013 at 10:55 AM

No I did not.

 

Now It works perfectly.

 

Thanks

Jan 23, 2013 at 5:47 PM

Glad you got it working!

Pawel

Aug 18, 2013 at 2:39 AM
HI
I get the same problem. Can you tell me how to solve?

Thanks
Aug 18, 2013 at 5:04 AM
Have you followed steps from Getting and Building Code section from https://entityframework.codeplex.com/documentation? Step 5 contains instructions on disabling strong name verification for EF assemblies you are building.

Hope this helps.
Pawel