Avamar: SQL Plug-in backup fails with "Failed to connect to server" error
Summary: Backup jobs fail because the Avamar SQL plug‑in cannot connect to the SQL instance, caused by a corrupted System.EnterpriseServices.Wrapper.dll that throws a BadImageFormatException.
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Symptoms
Avamar SQL Plug‑in cannot browse the SQL instance, causing backup jobs to fail with the following error:
Error <40258>: sqlconnectimpl_smo::connect Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server <INSTANCE>. ---> System.BadImageFormatException: Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
Relevant log excerpts show the SMO managed DLL loading:
2022-04-26 13:04:56 avsql Info <42545>: SMO managed DLL loaded for SQL server 2014 (SMO DLL version 12).
2022-04-26 13:04:56 avsql Error <40258>: sqlconnectimpl_smo::connect Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server <INSTANCE>. ---> System.BadImageFormatException: Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) ---> System.BadImageFormatException: Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1) ---> System.BadImageFormatException: Could not load file or assembly 'System.EnterpriseServices.Wrapper.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Transactions.Transaction.JitSafeGetContextTransaction(ContextData contextData)
at System.Transactions.Transaction.FastGetTransaction(TransactionScope currentScope, ContextData contextData, Transaction& contextTransaction)
.
.
at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()
at SMOWrap.SMO_Connect(SMOWrap* , Char* server, Char* login, Char* password, Int32 timeout, Char* file_description, Boolean applicationintentreadonly)
2022-04-26 13:04:56 avsql Warning <19462>: SMO connection failed.
PowerShell SMO browse test is failing:
PS <#########>> [reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
GAC Version Location
--- ------- --------
True v2.0.50727 C:\Windows\assembly\GAC_MSIL\Microsoft.SqlServer.Smo\12.0.0.0__89845dcd8080cc91\Microsoft.SqlS...
PS <#########>>
PS <#########>> $srv = new-object ("Microsoft.SQLServer.Management.Smo.Server")
PS <#########>>
PS <#########>> foreach($sqlDatabase in $srv.databases) {$sqlDatabase.name}
The following exception occurred while trying to enumerate the collection: "Failed to connect to server ..".
At line:1 char:25
+ foreach($sqlDatabase in $srv.databases) {$sqlDatabase.name}
+ ~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ExtendedTypeSystemException
+ FullyQualifiedErrorId : ExceptionInGetEnumeratorCause
The failure is caused by a corrupted System.EnterpriseServices.Wrapper.dll library. The DLL becomes invalid after an abrupt power loss or an unexpected Windows Server reboot, resulting in a System.BadImageFormatException when the Avamar SQL Plug‑in attempts to load it.
- Corruption of the DLL makes it a non‑valid
Win32binary. - The exception propagates as
“Failed to connect to server … System.BadImageFormatException”. - The underlying cause is the improper shutdown that interrupts the DLL loading process.
Resolution
Apply the following steps to restore the Avamar SQL Plug‑in functionality:
- Open Add/Remove Programs in the Control Panel, select Microsoft .NET Framework 4.x, and click Repair.
- Reinstall Microsoft .NET Framework 4.x.
- Reinstall the latest Visual Studio updates.
- Run Windows Update to apply any pending patches.
Affected Products
Avamar, AvamarArticle Properties
Article Number: 000201294
Article Type: Solution
Last Modified: 15 أيلول 2026
Version: 3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.