| Author |
Message |
Gillian
Joined: 02 Mar 2011 Posts: 4
|
Posted: Thu Mar 24, 2011 9:52 am Post subject: Type-Initialisation function for aM has caused an exception |
|
|
Hello,
I'm trying to do a schema compare with a backup file.
I followed the instructions on http://78.31.104.66/index.php/Schema_Object_Restore_from_Backup_SDK_8.
But when i run the code it shows the exception "Type-Initialisation function for aM has caused an exception".
my code:
| Code: |
Public Shared Function RegisterBackup(ByVal filename As String, ByVal databaseName As String) As Global.RedGate.SQLCompare.Engine.ReadFromBackup.BackupSetDatabase
Dim bdsBackup = New Global.RedGate.SQLCompare.Engine.ReadFromBackup.BackupDatabaseSource
Dim files As New List(Of String)(1)
files.Add(filename)
bdsBackup.Files = files
Dim bsdBackup As New Global.RedGate.SQLCompare.Engine.ReadFromBackup.BackupSetDatabase
Dim cpBdsBackup As ConnectionProperties = bdsBackup.ToConnectionProperties
bsdBackup.Register(cpBdsBackup, Global.RedGate.SQLCompare.Engine.Options.Default)
Return bsdBackup
End Function
|
When i call the ToConnectionProperties, i get the error.
When I "watch" the BackupDatabaseSource.
I see the error in the IsCaseSensitive property
In the Innerexception underneath that there is another error: Can't load one or more multiple types. Look at LoaderException property for more information.
So when i watch that. I get a specific error:
The method get_IsIncomplete in the type Redgate.BackupReader.BackupSet out of the assembly RedGate.BackupReader, Version=1.3.0.106, Culture=neutral, PublicKeyToken=7f465a1c156d4d57 does not have an implementation.
Note: I translated the errors from dutch to english. They could be slightly different.
How can I solve this issue?
Thanks in advance,
Gillian |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Fri Mar 25, 2011 5:41 pm Post subject: |
|
|
Hello,
Are you trying to compare a SQL Backup file or a regular backup file? You may just need to reference RedGate.BackupReader.SqbReader.dll. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Gillian
Joined: 02 Mar 2011 Posts: 4
|
Posted: Mon Mar 28, 2011 8:06 am Post subject: Re: |
|
|
| Brian Donahue wrote: |
Hello,
Are you trying to compare a SQL Backup file or a regular backup file? You may just need to reference RedGate.BackupReader.SqbReader.dll. |
Thank you for your reply
I've already referenced Redgate.BackupReader.SqbReader.dll. Specific Version is set to false and i've added them locally.
I'm trying to compare a .bak file which I created with SMO. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Mon Mar 28, 2011 9:17 am Post subject: |
|
|
Compiling the application as 32-bit (x86)? Because the backupreader DLL is 32-bit only. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Gillian
Joined: 02 Mar 2011 Posts: 4
|
Posted: Mon Mar 28, 2011 9:52 am Post subject: |
|
|
| I know, I'm compiling it as a x86.. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Mon Mar 28, 2011 11:06 am Post subject: |
|
|
Have you also put RedGate.Shared.Utils.dll in the output folder? The BackupSet class implements IRedGateSerializable, which is in that assembly. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Gillian
Joined: 02 Mar 2011 Posts: 4
|
Posted: Mon Mar 28, 2011 11:21 am Post subject: |
|
|
Yes,
I've referenced:
RedGate.BackupReader.dll
RedGate.BackupReader.SqbReader.dll
RedGate.Licensing.Client.dll
RedGate.Shared.SQL.dll
RedGate.Shared.Utils.dll
RedGate.SQLCompare.ASTParser.dll
RedGate.SQLCompare.Engine.dll
RedGate.SQLCompare.Rewriter.dll
RedGate.SQLDataCompare.Engine.dll
I've also added the xml files.. Just trying.. But that doesn't work either.. |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6344 Location: Red Gate Software
|
Posted: Mon Mar 28, 2011 2:21 pm Post subject: |
|
|
Maybe mismatched versions of some RedGate components. Did you replace any of the DLLS with versions from different packages? For instance, different versions of the assemblies exist in the SDK distribution compared to SQL and Data Compare.
You may also have some outdated RedGate.* dlls in the GAC. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Authorized_
Joined: 02 Mar 2011 Posts: 5
|
Posted: Tue Mar 29, 2011 1:50 pm Post subject: |
|
|
I have uninstalled "SQL Toolbelt", ran a Registery cleaner, checked if all files were deleted from the GAC. Rebooted, and installed "SQL Toolbelt" again.
I added the "new" libraries, and it worked!
Thank you very much for your support. |
|
| Back to top |
|
 |
|