2010-09-20 73 views
0

我试图在我的服务器上运行测试,但它由于一些C++错误来自MSVCR80.dll失败。在我的机器上它运行平稳,但在服务器上,我找不到使其工作的方法。MSVCR80.dll使用Microsoft.SqlServer.Management 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); 

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

[/编辑]

+0

http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/6d16ecce-f92b-4c53-a45b-40119c4566a6/ – DumbCoder 2010-09-20 08:42:47

+0

thx为链接,但我认为我的问题更依赖于一些微软产品安装不当。它来自“Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery”,它是来自Microsoft的一些内部代码行。 – Arthis 2010-09-20 08:53:08

回答

0

而不只是下载一个DLL(可能缺少其他的依赖),你尝试下载和安装Microsoft Visual C++ 2005 SP1 Redistributable

编辑,至于在Visual Studio中运行你的解决方案: 那么,错误的位置已经很明显,给出了堆栈跟踪。由于这是加载本地DLL的错误,因此我在谈论更多关于运行WinDBG的知识,在这种情况下,它可能会提供有关什么被加载以及它失败的原因的更好信息。从异常代码和失败的方式来判断(可能在DllMain期间,即LoadLibrary),我想这是一个缺失的依赖关系。在这种情况下,WinDbg或DependencyWalker都可以帮助你,但是对于DependencyWalker,你必须知道在哪里看,也就是要分析哪个模块。

+0

不!它没有工作...... Thx都一样! – Arthis 2010-09-20 08:46:58

+0

你可以在该机器上运行调试器吗? – 2010-09-20 08:57:14

+0

感谢您的精度。我会看看我能做什么,而不是那个领域的专家...... – Arthis 2010-09-20 09:34:46