C# C++;使用Microsoft.SqlServer.Management在MSVCR80.dll上失败 我试图在我的服务器上运行测试,但是由于来自MVCR80.DLL的C++错误,它失败了。在我的机器上,它运行平稳,但在服务器上,我找不到使它工作的方法

C# C++;使用Microsoft.SqlServer.Management在MSVCR80.dll上失败 我试图在我的服务器上运行测试,但是由于来自MVCR80.DLL的C++错误,它失败了。在我的机器上,它运行平稳,但在服务器上,我找不到使它工作的方法,c#,c++,sql-server,C#,C++,Sql Server,以下是我在运行测试时遇到的错误(很抱歉,它是意大利语的,但很容易理解,我想,每个人都说意大利语,不是吗?) 我尝试下载dll MSVCR80并将其放在windows/system32上,但没有帮助。以前有人遇到过这个问题吗 谢谢你的帮助 [编辑] 调试一个测试时,错误发生在那里(第2行): 脚本文本包含用于创建或删除表的代码,以便在与生产环境类似的环境中执行测试 [/EDIT]您是否尝试过下载和安装DLL,而不是下载单个DLL(可能缺少其他依赖项) 编辑,对于在Visual Studio中运行解

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

我尝试下载dll MSVCR80并将其放在windows/system32上,但没有帮助。以前有人遇到过这个问题吗

谢谢你的帮助

[编辑]

调试一个测试时,错误发生在那里(第2行):

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


[/EDIT]

您是否尝试过下载和安装DLL,而不是下载单个DLL(可能缺少其他依赖项)

编辑,对于在Visual Studio中运行解决方案:
考虑到堆栈跟踪,错误位置已经很明显了。由于加载本机DLL时出错,所以我更多地讨论了运行WinDBG,在本例中,WinDBG可能会提供有关加载内容和失败原因的更好信息。从异常代码和失败的方式(可能在DllMain期间,即LoadLibrary)判断,我猜这是一个缺少的依赖项。在这种情况下,WinDbg或DependencyWalker都可以帮助您解决问题,但使用DependencyWalker,您必须知道要查找的位置,即要分析的模块。

thx获取链接,但我认为我的问题更多地取决于microsoft产品的某些错误安装。它来自“Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteOnQuery”,这是来自Microsoft的一些内部代码行。您能在该计算机上运行调试器吗?谢谢您的精确性。我会看看我能做些什么,不是这方面的专家…再次感谢您的支持,因为我无法解决这个问题,我选择了另一种方法从c#运行sql脚本。希望有一天能帮助你作为回报!再见!没有找到解决这个特定问题的任何方法,所以我使用了一种变通方法。谢谢,很抱歉打扰你。。。
 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
  Microsoft.SqlServer.Management.Smo.Server server = new Microsoft.SqlServer.Management.Smo.Server(svrConnection);
 return server.ConnectionContext.ExecuteNonQuery(scriptText);