SafeToSql Extraction Error - System.IO.FileLoadException : Resolution

Post questions on how to interpret your Bullhorn SQL Server backup of your Database.

Moderators: StaffingSupport, s.emmons

drmmr763
User
Posts: 2
Joined: Thu Jul 14, 2016 10:54 am

SafeToSql Extraction Error - System.IO.FileLoadException : Resolution

Postby drmmr763 » Thu Jul 14, 2016 10:58 am

We are attempting to view / extract our provided database backup.

We have followed the documentation page here (http://bullhorn.force.com/pkb/articles/ ... ata-Backup)

When attempting to run the SafeToSql utility we get this error:

Code: Select all


C:\Program Files (x86)\Idera\SafeToSQL>SafeToSql "C:\Users\Chad \Documents\Data\_1317_BULLHORN963_2016_07_11_Database\BULLHORN963\BULLHORN963_FULL_2014_2016.07.07_00.39.13.safe" -Output "C:\Users\Chad\Documents\Data\_1317_BULLHORN963_2016_07_11_Database\BULLHORN963" -Password *** -List

SQLsafe SafeToSQL Version 8.2.0.290 (x86)
Copyright (c) 2004-2014 Idera, Inc., All Rights Reserved.
<http://www.idera.com/>
An error occurred while initializing support for SQL Server native backups.  Only SQLsafe archives will be readable.  Diagnostic Information follows:

System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
   at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
   at System.Reflection.Assembly.LoadFile(String path)
   at Idera.SQLsafe.Shared.Service.Backup.BackupSetHeader..cctor()

BULLHORN963     Full    PRIMARY BULLHORN963_Data        D:\LG1022_DATA\MSSQL$BULLHORN_LG1022\Data\BULLHORN963_Data.mdf
BULLHORN963     Full    BULLHORN_INDEX  BULLHORN963_Index       D:\LG1022_DATA\MSSQL$BULLHORN_LG1022\Data\BULLHORN963_Index.mdf
BULLHORN963     Full    BULLHORN_DATA   BULLHORN_DATA2  D:\LG1022_DATA\MSSQL$BULLHORN_LG1022\Data\BULLHORN963_DATA2.ndf
BULLHORN963     Full    NULL    BULLHORN963_Log L:\LG1022_LOGS\BULLHORN963_Log.mdf


--

Things we have done to attempt resolve the issue:
- The backup file was 32gb. I have 64 gb of free disk space available. Unless the backup is expected to exceed 64gb I don't believe this error is due to running out of disk space.
- Tried to run the utility using both the x86 and normal versions; both scripts give the same error.
- Searched for some answers on google but not found any relevant or related errors.

Any guidance or assistance with extracting the backup is appreciated.

apsmith
Site Admin
Posts: 2056
Joined: Wed Dec 31, 1969 8:00 pm

Re: SafeToSql Extraction Error - System.IO.FileLoadException

Postby apsmith » Fri Jul 15, 2016 9:53 am

Please contact Bullhorn Support for more direct assistance.
Andrew Smith
Director, Technical Operations
Developer Forum Admin

seanmartin
User
Posts: 1
Joined: Fri Aug 12, 2016 4:02 pm

Re: SafeToSql Extraction Error - System.IO.FileLoadException

Postby seanmartin » Fri Aug 12, 2016 4:03 pm

Has anyone discovered a solution to this problem?

sthornburg
User
Posts: 1
Joined: Tue Aug 16, 2016 7:05 pm

Re: SafeToSql Extraction Error - System.IO.FileLoadException

Postby sthornburg » Tue Aug 16, 2016 7:17 pm

Had the same error and found a solution. The issue is a .NET "mixed-mode" issue which in my limited understanding means the command is running the wrong version of the .NET class.

To resolve this, go to the Program Files directory where you installed Idera (e.g. C:\Program Files\Idera or appropriate on your machine) and drill down to the SafeToSQL directory.
Find the file: SafeToSQL.exe.config.
Edit it to add the "useLegacyV2RuntimeActivationPolicy" attribute to the <startup> node as follows:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>


Save and then run SafeToSQL.exe . That should resolve the error

Thank you to the people at http://stackoverflow.com/questions/3179028/mixed-mode-assembly-in-net-4 who identified how to fix this error.

drmmr763
User
Posts: 2
Joined: Thu Jul 14, 2016 10:54 am

Re: SafeToSql Extraction Error - System.IO.FileLoadException

Postby drmmr763 » Wed Nov 16, 2016 9:48 am

Hey All,

Several months later and I'm back to this issue :)

The first time around, I was able to resolve it with help from Idera. I emailed their support team and received some great help from their team. Below is the email that resolved my issue:

Solution Title SafeToSQL .net error
Solution Details SOLUTION NUMBER: 00011480


SYMPTOM:
When using SafeToSQL 8.2.0 to convert a .safe backup archive to a native .bak SQL Server archive, you receive the following error message, even when using a valid SQLsafe archive file.
An error occurred while initializing support for SQL Server native backups. Only SQLsafe archives will be readable.
Diagnostics Information follows:
System.IO.FileLoadException: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
at Idera.SQLsafe.Shared.Service.Backup.BackupSetHeader..cctor()
The header for the backup archive cannot be read. The file may not be a valid backup archive.

CAUSE:
There is conflict in the versions of .net used when the archive is backed up and the .net version used when the file conversion is performed.

SOLUTION:
Development is aware of the issue and looking for a permanent fix to be included in a future release of SQLsafe. The article will be update accordingly when a version of SQLsafe is available which includes a fix for this issue.

WORKAROUND:
This can be corrected by replacing the 'SafeToSQL.exe.config' file found in the SafeToSQL installation path with the one attached.
The default installation path is "C:\Program Files\Idera\SafeToSQL".


You'll notice the work around mentioned references a file that was attached. That file is actually the exact same fix that @sthornburg posted in August:

sthornburg wrote:Had the same error and found a solution. The issue is a .NET "mixed-mode" issue which in my limited understanding means the command is running the wrong version of the .NET class.

To resolve this, go to the Program Files directory where you installed Idera (e.g. C:\Program Files\Idera or appropriate on your machine) and drill down to the SafeToSQL directory.
Find the file: SafeToSQL.exe.config.
Edit it to add the "useLegacyV2RuntimeActivationPolicy" attribute to the <startup> node as follows:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>


Save and then run SafeToSQL.exe . That should resolve the error

Thank you to the people at http://stackoverflow.com/questions/3179028/mixed-mode-assembly-in-net-4 who identified how to fix this error.


I've just had to re-apply the fix for another archive from Bullhorn, and I used the above solution and so far it appears to be working as expected.

pmularski
Bullhorn Support Staff
Posts: 880
Joined: Wed Dec 31, 1969 8:00 pm

Re: SafeToSql Extraction Error - System.IO.FileLoadException

Postby pmularski » Wed Nov 16, 2016 3:55 pm

Good Afternoon Drummr763,

Thank you very much for your post. I am actually going to sticky this topic, in case future users have this same problem.
Patrick Mularski
Senior Enterprise Support Analyst
B U L L H O R N
Staffing and Recruiting Software, On Target, On Demand
Bullhorn Support Contact Numbers
US: 617-478-9126
UK: 44 800 032 2848
Australia: 61 28 073 5089
International: 617-478-9131


Return to “BH Backup Information”

Who is online

Users browsing this forum: No registered users and 0 guests

cron