我試圖在我的服務器上運行測試,但它由於一些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