我试图在我的服务器上运行测试,但它由于一些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);
脚本文本包含我用它来创建或删除我的表来执行我的测试代码在与生产类似的环境中。
[/编辑]
http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/6d16ecce-f92b-4c53-a45b-40119c4566a6/ – DumbCoder 2010-09-20 08:42:47
thx为链接,但我认为我的问题更依赖于一些微软产品安装不当。它来自“Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery”,它是来自Microsoft的一些内部代码行。 – Arthis 2010-09-20 08:53:08