1
Vote

System.IO.FileNotFoundException occurred

description

I am using VS2012 Ultimate with Update 4 and have installed xUnit v1.9.2 with xUnit TestRunner 0.99.7.

At first my tests were discovered in the VS Test Explorer and were running too but every time I tried to invoke DEBUG TEST, I will run into an error which would say something like "Process could not find a parent Id -1". I don't have the exact message because I rebooted couple of times my machine forgot to save the exact message. The way it got fixed was when I selected (highlighted) a complete test which had the breakpoint in it and then invoked DEBUG ALL TESTS. That's when the debugger started working for me. Since then I do not need to highlight anymore which is very weird as to why did I need to do that in the first place.

Now that the debugger is working I'm getting the following error. I have searched my entire hard drive and this file is not found anywhere. I do not understand why Visual Studio is looking for this file. Can someone help? I have also attached the VS2012 CallStack which shows the code path that leads to this exception.
System.IO.FileNotFoundException occurred
  HResult=-2147024894
  Message=Could not load file or assembly 'xunit.runner.visualstudio.testadapter.XmlSerializers, Version=0.99.7.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
  Source=mscorlib
  FileName=xunit.runner.visualstudio.testadapter.XmlSerializers, Version=0.99.7.0, Culture=neutral, PublicKeyToken=null
  FusionLog==== Pre-bind state information ===
LOG: DisplayName = xunit.runner.visualstudio.testadapter.XmlSerializers, Version=0.99.7.0, Culture=neutral, PublicKeyToken=null, processorArchitecture=MSIL
 (Fully-specified)
LOG: Appbase = file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\vstest.executionengine.x86.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/xunit.runner.visualstudio.testadapter.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/xunit.runner.visualstudio.testadapter.XmlSerializers/xunit.runner.visualstudio.testadapter.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/xunit.runner.visualstudio.testadapter.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/xunit.runner.visualstudio.testadapter.XmlSerializers/xunit.runner.visualstudio.testadapter.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/xunit.runner.visualstudio.testadapter.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/xunit.runner.visualstudio.testadapter.XmlSerializers/xunit.runner.visualstudio.testadapter.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/xunit.runner.visualstudio.testadapter.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 11.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Extensions/xunit.runner.visualstudio.testadapter.XmlSerializers/xunit.runner.visualstudio.testadapter.XmlSerializers.EXE.

  StackTrace:
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
  InnerException: 

file attachments

comments

achugh wrote Jul 11, 2014 at 8:29 AM

If I continue moving forward with the above exception, I will get another exception see below. It seems the test runner extension is not installing/copying the xUnit dependency dll. The xUnit gets copied by nuGet into the packages folder but is nowhere to be found where the runner is installed by the VS2012 resulting in the exception below

FYI, all this time, I've been running VS2012 as Administartor i.e. the "Run as Administrator" checkbox is checked for the VS2012 shortcut that I click on to launch/start VS2012.
System.IO.FileNotFoundException occurred
  HResult=-2147024894
  Message=Could not load file or assembly 'xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c' or one of its dependencies. The system cannot find the file specified.
  Source=mscorlib
  FileName=xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c
  FusionLog==== Pre-bind state information ===
LOG: DisplayName = xunit, Version=1.9.2.1705, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c
 (Fully-specified)
LOG: Appbase = file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This is an inspection only bind.
LOG: Using application configuration file: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 11.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\vstest.executionengine.x86.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV/xunit.DLL.
LOG: Attempting download of new URL file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV/xunit/xunit.DLL.
LOG: Attempting download of new URL file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV/Extensions/xunit.DLL.
LOG: Attempting download of new URL file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV/Extensions/xunit/xunit.DLL.
LOG: Attempting download of new URL file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV/xunit.EXE.
LOG: Attempting download of new URL file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV/xunit/xunit.EXE.
LOG: Attempting download of new URL file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV/Extensions/xunit.EXE.
LOG: Attempting download of new URL file:///C:/USERS/ADMINISTRATOR/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/11.0/EXTENSIONS/F1YRONJL.CKV/Extensions/xunit/xunit.EXE.

  StackTrace:
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
  InnerException: