How to Use migration with existing database? - entity-framework

Today EF4.3.1 released.
http://blogs.msdn.com/b/adonet/archive/2012/02/29/ef4-3-1-and-ef5-beta-1-available-on-nuget.aspx.
Follow the blog: http://thedatafarm.com/blog/data-access/using-ef-migrations-with-an-existing-database/. I firstly run:add-migration initial but throw exception as below and no create folder migrations:
PM> add-migration initial
System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.ArgumentException: 参数不正确。 (异常来自 HRESULT:0x80070057 (E_INVALIDARG))
--- 内部异常堆栈跟踪的结尾 ---
在 System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
在 System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
在 System.Management.Automation.ComMethod.InvokeMethod(PSMethod method, Object[] arguments)
调用的目标发生了异常。
thus, I run Enable-migrations firstly. the folder migrations with Configuration.cs created.
I checked the database, under system tables without dbo._migrationhistory table.
then I run add-migration initial again. throw the same exception Mentioned before.
the Domain model in a project and the datacontext in another project which locate in DAL layer.
in my existing database Security there are several table such as role ,user and so on.
but no migration-history table.
there is only Iset Navigators in my datacontext. no match database tables.
My problem is how to get migration-history table and set up migration?

I finally found that if move the project out of solution Folder. it will work fine. maybe it's a bug.

Related

TargetInvocationException Scaffold-DbContext EF 5

I am trying to run the following scaffold the project is in .net 5. and I get this error
All my projects say
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
The one project that references efcore
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="5.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="5.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.4">
Error
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.TypeLoadException: Could not load type 'Microsoft.EntityFrameworkCore.Internal.SemanticVersionComparer' from assembly 'Microsoft.EntityFrameworkCore, Version=5.0.4.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
at Microsoft.EntityFrameworkCore.Design.OperationExecutor..ctor(IOperationReportHandler reportHandler, IDictionary args)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Microsoft.EntityFrameworkCore.Tools.ReflectionOperationExecutor..ctor(String assembly, String startupAssembly, String projectDir, String dataDirectory, String rootNamespace, String language, String[] remainingArguments)
at Microsoft.EntityFrameworkCore.Tools.Commands.ProjectCommandBase.CreateExecutor(String[] remainingArguments)
at Microsoft.EntityFrameworkCore.Tools.Commands.DbContextScaffoldCommand.Execute(String[] args)
at Microsoft.EntityFrameworkCore.Tools.Commands.CommandBase.<>c__DisplayClass0_0.<Configure>b__0(String[] args)
at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)
Exception has been thrown by the target of an invocation.
Saffold Command
Scaffold-DbContext "Server=1.1.1.1,1433;Initial Catalog=First;Persist
Security Info=False;User
ID=data;Password=data;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection
Timeout=30;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir
Model/DB -Force -Context S3Context -Project S3.Core.DataSync.Framework
-t Data,SyncSales
I have 3 projects 1 project containing EF Core. If I load all three projects and set the project that has references to EF Core as "Set as Startup" I no longer have this issue. As soon as I set what should be the the startup project I get this error

Facebook SDK for Unity - error after import to nonempty project

Since yesterday I'm trying to resolve issues with Facebook SDK for Unity.
I tried it out on completely empty Unity project and everything works fine. I can build it and run on Android device without any problems.
So, I thought I can import package to my game in the same way, but I couldn't be more wrong.
Immediately after import I got this 2 errors:
ArgumentNullException: Argument cannot be null.
Parameter name: path
System.String.StartsWith (System.String value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/String.cs:1549)
GooglePlayServices.PlayServicesResolver.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:27)
ArgumentNullException: Argument cannot be null.
Parameter name: path
System.IO.Directory.CreateDirectory (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:75)
GooglePlayServices.PlayServicesResolver.ResolveUnsafe (System.Action`1 resolutionComplete, Boolean forceResolution)
GooglePlayServices.PlayServicesResolver+<Resolve>c__AnonStorey11.<>m__19 ()
GooglePlayServices.PlayServicesResolver.ExecuteNextResolveJob ()
GooglePlayServices.PlayServicesResolver.Resolve (System.Action resolutionComplete, Boolean forceResolution, System.Action`1 resolutionCompleteWithResult)
GooglePlayServices.PlayServicesResolver.AutoResolve ()
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:183)
When I try to run project despite of this errors, I got new ones:
Gradle failed to fetch dependencies.
Failed to run 'C:\GameDev\AbstractRhythm\Temp\PlayServicesResolverGradle\gradlew.bat -b "C:\GameDev\AbstractRhythm\Temp\PlayServicesResolverGradle\PlayServicesResolver.scripts.download_artifacts.gradle" --no-daemon "-PANDROID_HOME=C:\Users\adrso\AppData\Local\Android\Sdk" "-PTARGET_DIR=C:\GameDev\AbstractRhythm\Assets\Plugins\Android" "-PMAVEN_REPOS=" "-PPACKAGES_TO_COPY=com.android.support:support-v4:25.3.1;com.android.support:appcompat-v7:25.3.1;com.android.support:cardview-v7:25.3.1;com.android.support:customtabs:25.3.1"'
stdout:
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files (x86)\Java\jdk1.7.0_55
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
stderr:
exit code: 1
UnityEngine.Debug:LogError(Object)
Google.Logger:Log(String, LogLevel)
GooglePlayServices.PlayServicesResolver:Log(String, LogLevel)
GooglePlayServices.<GradleResolution>c__AnonStorey14:<>m__20(Result)
GooglePlayServices.<GradleResolution>c__AnonStorey15:<>m__29()
GooglePlayServices.PlayServicesResolver:PumpUpdateQueue()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
NullReferenceException: Object reference not set to an instance of an object
GooglePlayServices.AndroidSdkManager+<Create>c__AnonStoreyA.<>m__C (GooglePlayServices.AndroidSdkPackageCollection packages)
GooglePlayServices.SdkManager+<QueryPackages>c__AnonStorey9.<>m__B (GooglePlayServices.Result result)
GooglePlayServices.SdkManagerUtil+<QueryPackages>c__AnonStorey4.<>m__4 (GooglePlayServices.Result result)
GooglePlayServices.CommandLineDialog+ProgressReporter.Update (GooglePlayServices.CommandLineDialog window)
GooglePlayServices.CommandLineDialog.Update ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:291)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:284)
UnityEditor.HostView.SendUpdate () (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:363)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:183)
I use: Facebook SDK for Unity version 7.13.0, Unity version 2018.1.0f2, Android API 28, Android SDK Build-Tools 28, Android SDK Platform-Tools 25.0.3, Android SDK Tools 25.2.4, Google Play services 49
Do you have any idea what's going on?
It required few steps to solve this problem:
Compare Assets/Plugins/Android/AndroidManifest.xml of unworking project with empty project that only have Facebook SDK.
Use Assets -> Play Services Resolver -> Android Resolver -> Force Resolve.
Check "Environment variables" in Windows, it turned out I had path to new JDK as well as old - remove old entry.
Make sure you don't have any app using same Facebook app ID on your device, you can only have one at a time.
I hope someone will save time thanks to this :)

Migrations after switching from EDMX to Code First throws MetadataException

I'm changing a project from using an EDMX file to Code First. The project is one of a few projects in a solution, and it only contains the entities and the DbContext class.
This is what I've done so far:
Removed the old project from the solution (but not deleted it just yet, just renamed the folder).
Added a new class library project to the solution, and given it the same name as the old one.
Used NuGet to add Entity Framework to the new project.
Copied all the entity classes that were generated by the old EDMX file to the new project and included them all.
Copied the DbContext class as well.
Modified the app.config file to change the connection string to a standard connection string without the metadata stuff.
Added a reference to all the other projects that uses to use the old project.
Everything looks good and it compiles with no errors, but when I try to enable-migrations it throws this error:
PM> enable-migrations
Checking if the context targets an existing database...
System.Data.Entity.Core.MetadataException: Unable to load the specified metadata resource.
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeResource.LoadResources(String assemblyName, String resourceName, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoader.Create(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.SplitPaths(String paths)
at System.Data.Entity.Core.Common.Utils.Memoizer`2.<>c__DisplayClass2.<Evaluate>b__0()
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Result.GetValue()
at System.Data.Entity.Core.Common.Utils.Memoizer`2.Evaluate(TArg arg)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetArtifactLoader(DbConnectionOptions effectiveConnectionOptions)
at System.Data.Entity.Core.Metadata.Edm.MetadataCache.GetMetadataWorkspace(DbConnectionOptions effectiveConnectionOptions)
at System.Data.Entity.Core.EntityClient.EntityConnection.GetMetadataWorkspace()
at System.Data.Entity.Core.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection()
at System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor, ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, Translator translator, ColumnMapFactory columnMapFactory)
at System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel()
at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()
at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
at System.Data.Entity.Internal.LazyInternalContext.get_ModelBeingInitialized()
at System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(DbContext context, XmlWriter writer)
at System.Data.Entity.Utilities.DbContextExtensions.<>c__DisplayClass1.<GetModel>b__0(XmlWriter w)
at System.Data.Entity.Utilities.DbContextExtensions.GetModel(Action`1 writeXml)
at System.Data.Entity.Utilities.DbContextExtensions.GetModel(DbContext context)
at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration, DbContext usersContext, DatabaseExistenceState existenceState, Boolean calledByCreateDatabase)
at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration)
at System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor(DbMigrationsConfiguration migrationsConfiguration)
at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.Run()
at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldInitialCreate(String language, String rootNamespace)
at System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Unable to load the specified metadata resource.
It looks like it still thinks I'm using an EDMX. I also get this error when I try to run the application.
What am I missing?
You have to change the connection string of the starter project (asp.net or winforms project).

Set StartUp Project parameter for Entity Framework migrations

When using EF 4.3.1 migrations every time i need to add a migration or update database i have to use the StartUpProject parameter. Can I set this somewhere so I don't have to keep doing this? I don't want to set my data project as the start up project. My context and migrations are in different projects if that makes a difference.
Exception thrown when not using StartpProject parameter:
update-database -verbose
Using NuGet project 'Data.Deployment'.
Using StartUp project ''.
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
--- End of inner exception stack trace ---
at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.Management.Automation.ComMethod.InvokeMethod(PSMethod method, Object[] arguments)
Exception has been thrown by the target of an invocation.
At least with Entity Framework 6, to specify the Startup Project use the -StartUpProjectName parameter with update-database:
update-database -StartUpProjectName <String>
You can use the get-help command within Package Manager Console to view possible parameters for commands:
get-help update-database -detailed
Use the StartupProject parameter: Update-database -StartupProject "PROJECTNAME"
I'm not sure if this is what you're talking about, but you can set the default project in the Package Manager Console to the project where your Migrations config resides in; it's the rightmost dropdown list.
This way I've never had to provide the startup project as an argument.
A clean way around this is to attach a Test Project to the solution.
Even if you don't want to write lots of unit tests, it's an appropriate start-up project for a data layer namespace or similar.
That makes your start up issue cleaner, the package manager applies to the whole solution IIRC - so make sure the default project is the one with the migrations folder in it.

Running nunit-console on a solution file leads to System.IO.FileLoadException

When I try to use nunit-console.exe to run all the tests in a solution file as such:
nunit-console.exe MyProject.sln
I get the following exception (shown below). However when run the console runner on ANY of the projects in my folder structure, the runner works just fine and never gives me the following exception. I also am pretty certain that the version of the nunit library that I am linking to is the same as the runner that I am using. Also, my solution doesn't reference any projects that are outside the directory structure containing my .sln file.
Does anyone have any clue what I can do!? :(
Thanks!
Phil
NUnit version 2.5.10.11092
Copyright (C) 2002-2009 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.
Runtime Environment -
OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
CLR Version: 4.0.30319.1 ( Net 4.0 )
ProcessModel: Default DomainUsage: Default
Execution Runtime: net-4.0
Unhandled Exception:
System.IO.FileLoadException: Could not load file or assembly 'nunit.framework, Version=2.5.10.11092, Culture=neutral, Pu
blicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The located assembly's manifest definition does not match the
assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77'
Server stack trace:
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount,
IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInsta
ntiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHa
ndle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethod
Arguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope
, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilte
rType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMeth
odInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken,
Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecorate
dTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at NUnit.Core.CoreExtensions.InstallAdhocExtensions(Assembly assembly)
at NUnit.Core.Builders.TestAssemblyBuilder.Load(String path)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, Boolean autoSuites)
at NUnit.Core.Builders.TestAssemblyBuilder.Build(String assemblyName, String testName, Boolean autoSuites)
at NUnit.Core.TestSuiteBuilder.Build(TestPackage package)
at NUnit.Core.SimpleTestRunner.Load(TestPackage package)
at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
at NUnit.Core.ProxyTestRunner.Load(TestPackage package)
at NUnit.Core.RemoteTestRunner.Load(TestPackage package)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server,
Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExec
uteInContext)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at NUnit.Core.TestRunner.Load(TestPackage package)
at NUnit.Util.TestDomain.Load(TestPackage package)
at NUnit.ConsoleRunner.ConsoleUi.Execute(ConsoleOptions options)
at NUnit.ConsoleRunner.Runner.Main(String[] args)
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].
Try using the Fusion Log Viewer to see what assembly is failing to load. It should tell you not only what file it is failing on, but where it tried looking for that file.
In my case nunit-console.exe did not respect the assembly redirection from web|app.config. unless you provide /domain=multiple
My Problem:
EntityFrameworkTesting.Moq -> requests Moq, Version=4.2.1409.1722
I had already a newer assembly referenced.
The solution for me was to add /domain=multiple parameter. see the NUnit docs
So I run:
D:\tools\NUnit-2.6.4\bin\nunit-console.exe %SOLUTION_PATH%\Project.sln /config:Release /framework:net-4.0 /domain=multiple /xml=nunit-result.xml