question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code coverage fails after upgrading to VS 15.7.5

See original GitHub issue

Hi, I updated VS to version 15.7.5 released a few days ago and AxoCover stopped being able to show the coverage. To solve this, I created a new testing project with only the following test:

namespace UnitTestProject1
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
        }
    }
}

I already uninstalled completely VS and installed it again. AxoCover worked for a while, and then stopped working again. Here is the detailed output:

Executing tests… | Runner version is 1.1.389.0. | We are on x86 platform. SerializableException: Could not load file or assembly ‘AxoCover.Runner.XmlSerializers, Version=1.1.389.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified. 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) SerializableException: Could not load file or assembly ‘AxoCover.Runner.XmlSerializers’ or one of its dependencies. The system cannot find the file specified. 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) | File redirection is enabled for the following files: | C:\Users\Pablo\AppData\Local\Microsoft\VisualStudio\15.0_6cc15c00\Extensions\ntrocxop.dn2\MSTestAdapter\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll | C:\Users\Pablo\AppData\Local\Microsoft\VisualStudio\15.0_6cc15c00\Extensions\ntrocxop.dn2\MSTestAdapter\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll | C:\Users\Pablo\AppData\Local\Microsoft\VisualStudio\15.0_6cc15c00\Extensions\ntrocxop.dn2\MSTestAdapter\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll | C:\Users\Pablo\AppData\Local\Microsoft\VisualStudio\15.0_6cc15c00\Extensions\ntrocxop.dn2\MSTestAdapter\Microsoft.VisualStudio.TestPlatform.TestFramework.dll | C:\Users\Pablo\AppData\Local\Microsoft\VisualStudio\15.0_6cc15c00\Extensions\ntrocxop.dn2\MSTestAdapter\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll | Setting up file redirection hooks… | File redirection hooks are enabled.

Loading assembly from C:\Users\Pablo\AppData\Local\Microsoft\VisualStudio\15.0_6cc15c00\Extensions\ntrocxop.dn2\MSTestAdapter\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll… || Loaded executor: Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.MSTestExecutor << Assembly loaded. Running executor: Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.MSTestExecutor… || Processing tests in: C:\Users\Pablo\SkyDrive\Documents\Visual Studio 2017\Projects\UnitTestProject1\UnitTestProject1\bin\Debug\UnitTestProject1.dll… SerializableException: Element not found. (Exception from HRESULT: 0x80070490) SerializableException: Could not load file or assembly ‘Microsoft.VisualStudio.TestPlatform.ObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specified. at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment.AssemblyLoadWorker.GetTargetFrameworkVersionStringFromPath(String path) at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Deployment.AssemblyLoadWorker.GetTargetFrameworkVersionStringFromPath(String path) at Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Utilities.AppDomainUtilities.GetTargetFrameworkVersionString(String testSourcePath) Passed UnitTestProject1.UnitTest1.TestMethod1 << Executor finished. | File redirection rules are cleared. < Test execution finished. Shutting down… Exiting… Generating coverage report… SerializableException: The I/O operation has been aborted because of either a thread exit or an application request at System.ServiceModel.Channels.SocketConnection.HandleReceiveAsyncCompleted() Committing… No results, this could be for a number of reasons. The most common reasons are:

1) missing PDBs for the assemblies that match the filter please review the
output file and refer to the Usage guide (Usage.rtf) about filters.
2) the profiler may not be registered correctly, please refer to the Usage
guide and the -register switch.

Test execution finished.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

39reactions
axodoxcommented, Jul 20, 2018

I was able to reproduce it on my other machine. You are right it is indeed OpenCover. The problem is that it’s DLL registration does not work anymore - probably because of some change in Windows. Fortunately I have found a workaround for now:

  • Go to the directory where AxoCover is installed. You can locate this by running a long test (e.g. thread sleep, and open the file location of the AxoCover.Host-*.exe from the task manager. For example for me it is: C:\Users\axodo\AppData\Local\Microsoft\VisualStudio\15.0_6d93d79f\Extensions\pfu3q5ow.kny\
  • Then navigate to OpenCover\x86 or x64 depending on what platform your tests are running
  • Open CMD with admin right
  • Enter: regsvr32 /i OpenCover.Profiler.dll
  • You will get a dialog that DLL is registered.

Now your coverage will run again. I will check at the weekend to make this automatically in AxoCover, while OpenCover gets fixed. Or check if I can fix OpenCover myself.

5reactions
Eriteycommented, Jul 16, 2018

We’re getting the same error since we’ve updated our machines to the latest windows 10 updates. I’m guessing the issue is with OpenCover and not AxoCover but nothing has been reported on their Issues page yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot run Code Coverage on .NET Core 2.1 project that ...
In Visual Studio 2017 (15.7.5), when I attempt to run code coverage for xunit based tests (which target .NET Core 2.1 and reference...
Read more >
Gutter code coverage not working
However, the gutter code coverage does not work. Every box is gray and says "Statement uncovered by tests" even though the Unit Test...
Read more >
Visual Studio 2017 15.7 Release Notes
Release notes for the latest features and improvements in Visual Studio 2017 v15.7. Plan better, code together and ship faster with Visual ......
Read more >
Troubleshoot code coverage - Visual Studio
Code coverage isn't run, and either the code coverage window doesn't open at the end of the test run, or it shows old...
Read more >
Software Update Failed Error for iOS 15.7 on iPhone 8
The update server temporarily lost its communication with your phone during the download process. Power off the iPhone, wait a minute, then ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found