dions / migratordotnet

Automatically exported from code.google.com/p/migratordotnet
0 stars 0 forks source link

Exe error: "This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded." #177

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setup simple migration in test project built in C# .NET 4.0 framework

2. Run MigratorDotNet in command line

C:\Utils\MigratorDotNet>Migrator.Console.exe SqlServer connectionString="Data 
Source=.;Initial Catalog=TestDB;Integrat
ed Security=True;" "C:\MigratorTest\bin\MigratorTest.dll"

What is the expected output? What do you see instead?

I would like it to upgrade my DB to correct migration.  Instead, it throws 
error:

System.BadImageFormatException: Could not load file or assembly 
'file://C:\MigratorTest\bin\MigratorTest.dll' or one of its dependencies. This 
assembly is built by a runtime newer than the currently loaded runtime and 
cannot be loaded.
File name: 'file:///C:\MigratorTest\bin\MigratorTest.dll'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Migrator.MigratorConsole.MigratorConsole.GetMigrator() in c:\work\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Console\MigratorConsole.cs:line 159
   at Migrator.MigratorConsole.MigratorConsole.Migrate() in c:\work\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Console\MigratorConsole.cs:line 83
   at Migrator.MigratorConsole.MigratorConsole.Run() in c:\work\other_projects\migratordotnet\migratordotnet-trunk\src\Migrator.Console\MigratorConsole.cs:line 59

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].

What version of the product are you using? On what operating system? With what 
.NET implementation/version?

migrator v0.9.28138, Windows 7, .NET 4.0

What database and version are you seeing this issue on?
SqlServer 2008 R2

Original issue reported on code.google.com by anthony....@gmail.com on 15 Nov 2011 at 11:12

GoogleCodeExporter commented 8 years ago
This appears to be a result of the migrator.exe.config having a 
supportedRuntime value of v2.0.  If you change it to v4.0 it will likely work.  
Not sure why it is being distributed with a link to a specific runtime version.

Original comment by co...@bowern.com on 6 Jan 2012 at 5:26