MichalGrzegorzak / migratordotnet

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

SQLite.NET startup problem #140

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
--- What steps will reproduce the problem?
1. Download and install ADO.NET 2.0 Provider for SQLite 1.0.65.0 
(http://sourceforge.net/projects/sqlite-
dotnet2/files/SQLite%20for%20ADO.NET%202.0/) SQLite.NET 3.6.16 to system.
2. svn checkout http://migratordotnet.googlecode.com/svn/trunk/  or 
download migratordotnet 0.8 
3. Create any SQLite.NET db with any data
4. Create any migration script
5. Try to run

--- What is the expected output? What do you see instead?
Expected - no errors. Instead - many errors:
Migrator.Console.exe SQLite "Data Source=some_base.db" 
MyProject.Migration.dll -trace
System.Reflection.TargetInvocationException: Exception has been thrown by 
the target of an invocation. ---> 
System.Reflection.TargetInvocationException: Exception has been thrown by 
the target of an invocation. ---> System.BadImageFormatException: Could not 
load file or assembly 'System.Data.SQLite, Version=1.0.61.0, 
Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its 
dependencies. An attempt was made to load a program with an incorrect 
format.
File name: 'System.Data.SQLite, Version=1.0.61.0, Culture=neutral, 
PublicKeyToken=db937bc2d44ff139'
   at Migrator.Providers.SQLite.SQLiteTransformationProvider..ctor(Dialect 
dialect, String connectionString)

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

   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, 
SignatureStruct& signature, IntPtr declaringType)
   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, Object[] 
activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Migrator.Providers.Dialect.NewProviderForDialect(String 
connectionString)
in 
c:\Work\MyOwn\Job\Svn\JobFinder.WCF\JobFinder.WCF.Database.Migration\lib\mi
gratordotnet-read-only\src\Migrator.Providers\Dialect.cs:line 29
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] 
arguments, SignatureStruct& sig, MethodAttributes methodAttributes, 
RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags 
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, 
Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags 
invoke

---What version of the product are you using? On what operating system? ---
With what .NET implementation/version?
1. migratordotnet rev 141
2. Windows 7 x64
3. .NET Framework 3.5
4. ADO.NET 2.0 Provider for SQLite 1.0.65.0
5. SQLite.NET 3.6.16

---What database and version are you seeing this issue on?
SQLite.NET 3.6.16

---Please provide any additional information below.
After recompiling migratordotnet with installed ADO.NET 2.0 Provider for 
SQLite 1.0.65.0 and SQLite.NET 3.6.16 (System.Data.SQLite.DLL replaced with 
newest one) all works fine. 

Original issue reported on code.google.com by it.advis...@gmail.com on 11 Mar 2010 at 2:25

GoogleCodeExporter commented 9 years ago
Perhaps the problem is that your version of SQLite does not match your Windows 
7 x64. 
Try using a DLL as an attachment to this comment.

Original comment by dima117a@gmail.com on 12 Mar 2010 at 1:59

Attachments:

GoogleCodeExporter commented 9 years ago
You mean, that I need to replace System.Data.SQLite.dll to x64 version in 
migrator lib 
directory and rebuild again? 
Yes, I know that this way working fine. But I'am not understand why builded 
application 
looking into GAC instead of using local corresponding version.  

Original comment by amolyb...@gmail.com on 12 Mar 2010 at 4:33

GoogleCodeExporter commented 9 years ago
I think migrator.net is looking for version 1.0.61.0 and you have a reference to
version 1.0.65.0. I had the same problem and had to put this configuration 
block in
my machine.config to resolve it:
<runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139"
culture="neutral"/>
                <bindingRedirect oldVersion="0.0.0.0-1.0.65.0" newVersion="1.0.65.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>

This block usually goes in the app.config of your starting project (if you have 
a
WinForms or WPF project) but with the NAnt runner I could only get it to work 
with
the machine.config

Original comment by strombri...@gmail.com on 12 Mar 2010 at 6:21

GoogleCodeExporter commented 9 years ago
>> but with the NAnt runner I could only get it to work with
the machine.config

these settings can be specified in the App.config for NAnt

Original comment by dima117a@gmail.com on 13 Mar 2010 at 11:07

GoogleCodeExporter commented 9 years ago
@dima117a: Thanks :)

Original comment by strombri...@gmail.com on 13 Mar 2010 at 11:51

GoogleCodeExporter commented 9 years ago
Is it possible to have an example of the NAnt build file that works with SQLite 
?  

I'm able to user SqlServer as provider but all attempts to use SQLite failed 
for a "missing file".  I can't playt with the "machine.config" file so I wonder 
if I'll be able to use Migrator.net

Original comment by raymond....@gmail.com on 31 Aug 2010 at 3:17