开发者

C++ Failure on MSVCR80.dll using Microsoft.SqlServer.Management

开发者 https://www.devze.com 2023-01-17 06:50 出处:网络
I am trying to run test on my server but it fails due to some C++ error coming from MSVCR80.dll. On my machine it runs smoothly but on the server, I do not find a way to make it work.

I am trying to run test on my server but it fails due to some C++ error coming from MSVCR80.dll. On my machine it runs smoothly but on the server, I do not find a way to make it work.

Here is the error I have when running my tests (sorry it is in italian but it could be easily understood, I guess, everybody speaks italian, no?) :

 Class Initialization method Test.Quartz.GestioneQuartzTest.MyClassInitialize threw exception. System.Reflection.TargetInvocationException:  System.Reflection.TargetInvocationException: Eccezione generata dalla destinazione di una chiamata.
 --->  System.TypeInitializationException: L'inizializzatore di tipo di '<Module>' ha generato un'eccezione.
 --->  <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load during appdomain initialization.
 --->  System.DllNotFoundException: Impossibile caricare la DLL 'MSVCR80.dll': Routine di inizializzazione della libreria di collegamento dinamico (DLL) non riuscita. (Eccezione da HRESULT: 0x8007045A)..

and the stack Trace :

_encode_pointer(Void* )
_initatexit_app_domain()
LanguageSupport.InitializePerAppDomain(LanguageSupport* )
LanguageSupport._Initialize(LanguageSupport* )
LanguageSupport.Initialize(LanguageSupport* )
ThrowModuleLoadException(String errorMessage, Exception innerException)
ThrowModuleLoadException(String , Exception )
LanguageSupport.Initialize(LanguageSupport* )
cctor()
Microsoft.SqlServer.Management.Common.ExecuteBatch.GetStatements(String sqlCommand)
System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] provide开发者_Python百科dArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
Microsoft.SqlServer.Management.Common.ServerConnection.GetStatements(String query, ExecutionTypes executionType, Int32& statementsToReverse)
Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand)
Test.DataBaseHelper.ExecuteScriptFile(String RessourceName) in C:\CoreTest\TestHelper\DataBaseHelper.cs: line 35
Test.Quartz.GestioneQuartzTest.MyClassInitialize(TestContext testContext) in C:\CoreTest\Quartz\GestioneQuartzTest.cs: line 62

I have tried downloading the dll MSVCR80 and putting it on windows/system32 but it did not help. HAve someone already experienced this problem before?

Thx for any help.

[EDIT]

When debugging one test, the error happens there (2nd line) :

  Microsoft.SqlServer.Management.Smo.Server server = new Microsoft.SqlServer.Management.Smo.Server(svrConnection);
 return server.ConnectionContext.ExecuteNonQuery(scriptText);

The Script text contains the code I use to create or Drop my tables to perform my test in a similar environment as the production.

[/EDIT]


Instead of just downloading a single DLL (possibly missing other dependencies), have you tried downloading and installing the Microsoft Visual C++ 2005 SP1 Redistributable?

Edit, as for running your solution in Visual Studio: Well, the error location was pretty much already obvious, given the stack trace. Since this is an error loading a native DLL, I was talking more about running WinDBG, which in this case might provide better information about what gets loaded and why it is failing. Judging from the exception code and way of failing (probably during DllMain, i.e. LoadLibrary) I'd guess it's a missing dependency. Either WinDbg or DependencyWalker can help you out in this case, but with DependencyWalker, you'd have to know where to look, i.e. what module to analyze.

0

精彩评论

暂无评论...
验证码 换一张
取 消