Kevin K.
Kevin K.

Reputation: 65

VS2012: Can't attach profiler. Can't load assembly VSPerfControl.Interop Version=11.0.0.0

I'm using Visual Studio 2012 (11.0.61219.00) Update 5 on Windows 7 Professional SP1. I'd like to profile NUnit tests, which I've done in the past using VS2010 on a different system. This is the first time I've tried this on this box, which has a fairly fresh VS2012 install. When I try to attach the profiler to a running process using the Analyze | Profiler | Attach/Detach menu option, I get a dialog box containing the following error message:

Could not load file or assembly 'VSPerfControl.Interop, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I've done the following diagnostics:

I haven't found any helpful posts on this, so I'm hoping someone here can help me figure out what's wrong.

Update:

The final solution to this problem can be found in HelpfulPaul's post below, in the comments.

Upvotes: 1

Views: 1015

Answers (2)

HelpfulPaul
HelpfulPaul

Reputation: 68

I had this same issue. I used the VS cmd prompt to fix.

  1. Go to the start menu -> all programs -> Visual Studio 2015 -> Visual Studio tools
  2. Open the Developer command prompt
  3. Change folders to the directory you listed above by using the command: cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools
  4. Use the command: gacutil /i VSPerfControl.Interop.dll
  5. Restart Visual Studios

Upvotes: 5

Terje Sandstrøm
Terje Sandstrøm

Reputation: 1991

It seems you don't use the Test Explorer which have direct connection with the profiler.

In Visual Studio 2012 and upwards you have a test explorer that can handle different 3rd party test frameworks, among them NUnit. What you need to do is to either add a NUnit test adapter to your project (as a nuget package) or to Visual Studio (as a vsix extension). Once you have done that, you will see your tests in the Visual Studio Test Explorer.

Profiling is then available from the Test Explorer as a context sensitive menu item.
Profile test from Test Explorer

There are 2 versions of the NUnit Test Adapter, on for NUnit V2 and one NUnit V3.
The corresponding NUnit adapters for VS can be found here: https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d and https://visualstudiogallery.msdn.microsoft.com/0da0f6bd-9bb6-4ae3-87a8-537788622f2d.

Upvotes: 0

Related Questions