代码之家  ›  专栏  ›  技术社区  ›  Arthis

MsVCR80.DLL使用微软.SQL Server管理的C++故障

  •  0
  • Arthis  · 技术社区  · 16 年前

    我试图在我的服务器上运行测试,但是由于来自MVCR80.DLL的一些C++错误,它失败了。在我的机器上,它运行得很平稳,但在服务器上,我找不到使它工作的方法。

    这是我在进行测试时的错误(抱歉,它是意大利语的,但我想很容易理解,每个人都说意大利语,不是吗?):

     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)..
    

    以及堆栈跟踪:

    _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[] providedArgs, 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
    

    我尝试下载dll msvcr80并将其放在Windows/System32上,但没有帮助。以前有人经历过这个问题吗?

    THX需要帮助。

    [编辑]

    调试一个测试时,出现错误(第2行):

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

    脚本文本包含用于创建或删除表以在与生产环境类似的环境中执行测试的代码。

    [/编辑]

    1 回复  |  直到 16 年前
        1
  •  0
  •   Jim Brissom    16 年前

    您是否尝试下载和安装 Microsoft Visual C++ 2005 SP1 Redistributable ?

    编辑 ,对于在Visual Studio中运行解决方案: 考虑到堆栈跟踪,错误位置已经非常明显了。因为加载本机dll时出错,所以我更关注的是运行windbg,在本例中,它可能提供有关加载内容和失败原因的更好信息。从异常代码和失败的方式(可能是在dllmain期间,即loadlibrary)来看,我想这是一种缺失的依赖关系。在这种情况下,windbg或dependencywalker都可以帮助您解决问题,但是使用dependencywalker,您必须知道要查找的位置,即要分析的模块。