Type-Initialisation function for aM has caused an exception
Gillian
Posts: 5
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_Ob ... ckup_SDK_8.
But when i run the code it shows the exception "Type-Initialisation function for aM has caused an exception".
my code:
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
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_Ob ... ckup_SDK_8.
But when i run the code it shows the exception "Type-Initialisation function for aM has caused an exception".
my 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
Comments
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.
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..
You may also have some outdated RedGate.* dlls in the GAC.
I added the "new" libraries, and it worked!
Thank you very much for your support.