failed due to the following error: 800704a6 while trying to read data from a text file in teamcity

坚强是说给别人听的谎言 提交于 2019-12-04 02:15:31

问题


I am running some test cases using teamcity. It is saving the data on a textfile successfully but when I try to read that data from same location it is giving the following error

SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6. at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, LogonDialogHandler logonDialogHandler, Boolean createInNewProcess) at WatiN.Core.IE..ctor()

and replace the saved data with System.String[]. Also tried giving all permisssions to the user but still cant fix it. Please help.

I also have enabled most of the IE8 settings. Any idea what is causing this

Following is the build Log

[11:50:09]: NUnit report watcher
[11:50:09]: [NUnit report watcher] Watching paths: <no paths>
[11:50:09]: Project "Tests.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build;TeamCity_Generated_NUnitTests target(s)): (2m:10s)
[11:50:13]: Tests.dll (2m:06s)
[11:52:19]: [Tests.dll] Tests.bTests
[11:52:19]: [Tests.bTests] SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6.
[11:52:19]: [Tests.bTests] SetUp method failed. System.Runtime.InteropServices.COMException : Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the IClassFactory failed due to the following error: 800704a6.
       at WatiN.Core.IE.CreateNewIEAndGoToUri(Uri uri, LogonDialogHandler logonDialogHandler, Boolean createInNewProcess)
       at WatiN.Core.IE..ctor()
       at Tests.bTests.Setup() in Z:\TestProjects\Tests\Tests\bTests.vb:line 14
[11:52:20]: Some tests has failed in Z:\TestProjects\Tests\Tests\bin\Release\Tests.dll, tests run continued. Child test failed
[11:52:20]: 1 Test(s) failed.
[11:52:20]: [Project "Tests.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build;TeamCity_Generated_NUnitTests target(s)):] Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx(17, 5): c:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\BuildAgent\temp\buildTmp\tmp6D24.tmp exited with code 1.
[11:52:20]: MSBuild output:
[11:52:20]: CoreResGen:
[11:52:20]:   All outputs are up-to-date.
[11:52:20]: CoreCompile:
[11:52:20]:   c:\Windows\Microsoft.NET\Framework\v4.0.30319\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics /optionstrict:custom /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /nostdlib /rootnamespace:Tests /sdkpath:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0" /doc:obj\Release\Tests.xml /define:"CONFIG=\"Release\",TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:"C:\Program Files (x86)\NUnit 2.4.8\bin\nunit.framework.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Core.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.dll","C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Xml.dll","C:\Program Files (x86)\WatiN\bin\WatiN.Core.dll" /debug:pdbonly /optimize+ /out:obj\Release\Tests.dll /resource:obj\Release\Tests.Resources.resources /target:library aTests.vb bTests.vb cAmendmentTests.vb Functions.vb dCancelRefundTests.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb" "C:\BuildAgent\temp\buildTmp\.NETFramework,Version=v4.0.AssemblyAttributes.vb"
[11:52:20]: _CopyAppConfigFile:
[11:52:20]: Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.
[11:52:20]: CopyFilesToOutputDirectory:
[11:52:20]:   Copying file from "obj\Release\Tests.dll" to "bin\Release\Tests.dll".
[11:52:20]:   Tests -> Z:\TestProjects\Tests\Tests\bin\Release\Tests.dll
[11:52:20]:   Copying file from "obj\Release\Tests.pdb" to "bin\Release\Tests.pdb".
[11:52:20]:   Copying file from "obj\Release\Tests.xml" to "bin\Release\Tests.xml".
[11:52:20]: Done Building Project "Z:\TestProjects\Tests\Tests\Tests.vbproj" (default targets).
[11:52:20]: Done Building Project "Z:\TestProjects\Tests\Tests.sln" (default targets).
[11:52:20]: TeamCity_Generated_NUnitTests:
[11:52:20]:   c:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\BuildAgent\temp\buildTmp\tmp6D24.tmp
[11:52:20]: Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx(17,5): error : c:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\BuildAgent\temp\buildTmp\tmp6D24.tmp exited with code 1.
[11:52:20]: Done Building Project "Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build;TeamCity_Generated_NUnitTests target(s)) -- FAILED.
[11:52:20]: Build FAILED.
[11:52:20]: "Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx" (TeamCity_Generated_Build;TeamCity_Generated_NUnitTests target) (1) ->
[11:52:20]: (TeamCity_Generated_NUnitTests target) -> 
[11:52:20]:   Z:\TestProjects\Tests\Tests.sln.teamcity.patch.tcprojx(17,5): error : c:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe "@@" C:\BuildAgent\temp\buildTmp\tmp6D24.tmp exited with code 1.
[11:52:20]:     0 Warning(s)
[11:52:20]:     1 Error(s)
[11:52:20]: Time Elapsed 00:02:10.92
[11:52:20]: Build finished

回答1:


Not sure if this has been resolved or not but I was having the same error in 2 different test fixtures 1 written in C# the other written in VB.NET.

For the C# fixture all I need to do to resolve the issue is when I create a new instance of WatIn.IE, I added the second parameter to: IE var ie = new IE(url, true) The "true" tells WatIn to "createInNewProcess" which opens the next IE in a new process.

This, however, did not work for the test fixture written in VB.NET for some reason. For this fixture I had to call a method in one of our C# libraries to force an IE closure in each Tests "TearDown" method. The following C# code did the trick:

public static void CloseInternetExplorers()
{
  var processes = from process in Process.GetProcesses()
                  where process.ProcessName == "iexplore"
                  select process;

  foreach (var process in processes)
  {
    while (!process.HasExited)
    {
      process.Kill();
      process.WaitForExit();
    }
  }
}



回答2:


Reboot the machine

There are windows updates getting in the way of instantiating new COM objects.

Error code 800704a6 according to a few forums, and this ServerFault posts means ERROR_SHUTDOWN_IS_SCHEDULED




回答3:


Related with SetUp method failed while running tests from teamcity



来源:https://stackoverflow.com/questions/4364970/failed-due-to-the-following-error-800704a6-while-trying-to-read-data-from-a-tex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!