Profiling Unit Tests does not work (Failed to verify x64 COM object registration)
I have a C# unit test project targeting .NET 3.5 in Visual Studio 2013.
When i try to profile it (Unit Test Explorer | Profile Unit Tests -> Sampling -> Run) an error box pops up, saying: "Failed to verify x64 COM object registration: Empty path to COM object. Do you want to continue anyway?" Clicking yes results in a never ending test run, leaving the tests in pending state.
Running mstest as standalone application from the dotTrace application or from consoleprofiler.exe results in the same error message.
Profiling via ".NET process" and starting mstest from command line works but is not an option, as it needs retargeting the test project to .NET 4.0+ to use the /noisolation switch.
Please advise how to profile without retargeting, preferrably from within Visual Studio.
Versions:
Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.6.01055
JetBrains ReSharper Ultimate 2016.2.2 Build 106.0.20160913.91321
JetBrains dotTrace 2016.2.2 Build 106.0.20160913.94302
Please sign in to leave a comment.
Hi,
Could you please try to reboot your machine, install all updates for Windows and check if the issue persists?
Hi,
thanks for the advice!
After rebooting the message about COM objects has vanished. Profiling using dotTrace works. Profiling from within Visual Studio still does not work. Profiling via dotTrace GUI still is a little tedious (see description below) and any help on getting profiling from within Visual Studio to work would be greatly appreciated.
Current behaviour when profiling from within Visual Studio: After selecting "Sampling", a DotTrace Performance viewer starts up while all tests are still pending. While the viewer is initializing the tests start to change their state to "inconclusive". The viewer says "Snapshot is empty. Only overview information is available."
When profiling mstest via dotTrace GUI (Local->Standalone) i have to define the test dlls manually (via Arguments "/testcontainer:..."). Additionally under "Advanced" i have to check "Profile child processes". After the unit tests ran i need to dismiss the trace that opens up automatically and (back in the dotTrace GUI) open the trace of the captured child process "QTAgent..." via Recent->Snapshots. This works but is a little tedious
If this is of any interest: Installing windows updates is not possible as those are managed by a system administrator for the machine in question. I assume that the major updates are installed.
Edit:
DotCover exhibits similar behaviour when trying to run it from within Visual Studio.
Hmm, it's strange. Are there any issues if you just run unit tests from ReSharper's UT runner?
Running the tests from ReSharpers UT runner exposes similar behaviour as well. Additionally in the log of the session without profiling or coverage analysis there is a warning that might be helpful:
2016.10.31 10:49:10.387 WARN Die Datei oder Assembly "Microsoft.VisualStudio.QualityTools.ControllerObject, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
This translates to "the file or assembly ... or one of its dependencies was not found. The system cannot find the given file". The project references just Microsoft.VisualStudio.QualityTools.UnitTestFramework 10.1.0.0 and runs normally in Visual Studios Test runner.
Did you fixed this issue? I'm having the same problem.
Hi Guilherme,
Did you try to reboot your machine?
Hi Konstantin,
Yes, I tried reboot my machine and also I updated my windows.
Guilherme,
It looks like your account has a limited access rights. Could you please try to run Visual Studio under elevated account and check if the issue persists? If it persists, please create a support ticket ("Submit a Request" button in the upper right corner).
Guilherme,
not sure if this is an option for you (or any other ppl having the same problem), but:
When i change the target framework of the test project from 3.5 to 4 the tests do not end up inconclusive anymore.
Normal test execution and coverage seem to work after this change.
Caveats:
When profiling i get some data, but it does not contain any trace of my own test or production code. Just test infrastructure classes and methods.
Afaik, this change requires changing the target franework of production code to 4 as well, which is not applicable in my case.