New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support portable pdb files #610

Closed
jp7677 opened this Issue Jul 19, 2016 · 24 comments

Comments

Projects
None yet
6 participants
@jp7677

jp7677 commented Jul 19, 2016

Please provide the following information when submitting an issue, where appropriate replace the [ ] with a [X]

My Framework

  • .NET 2
  • .NET 3.5
  • .NET 4
  • .NET 4.5
  • .NET 4.6
  • .NET 4.6.1
  • .NET 4.6.2
  • .NET Core 1.0.0
  • Something else

My Environment

  • Windows 7 or below (not truly supported due to EOL)
  • Windows 8
  • Windows 8.1
  • Windows 10
  • Windows 10 IoT Core
  • Windows Server 2012
  • Windows Server 2012 R2 (Appveyor)
  • Windows Server 2016

I have already...

  • repeated the problem using the latest stable release of OpenCover.
  • reviewed the usage guide and usage document.
  • have looked at the opencover output xml file in an attempt to resolve the issue.
  • reviewed the current issues to check that the issue isn't already known.

My issue is related to (check only those which apply):

  • no coverage being recorded
  • 32 or 64 bit support
  • feature request

Expected Behavior

OpenCover should report some coverage when profiling dotnet core assemblies with portable pdb's.

Actual Behavior

The assemblies are skipped due to "MissingPdb"

Steps to reproduce the problem:

Compile a dotnet core assembly with "debugType": "portable" in buildOptions in the project.json and profile some tests using OpenCover.


Dotnet Core introduced a new format for pdb files (https://github.com/dotnet/core/blob/master/Documentation/diagnostics/portable_pdb.md). OpenCover shoud support this new format when profiling. As stated here #601 Mono.Cecil should provide the needed support. It seems the code is already there: jbevain/cecil@7cde491.

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Jul 19, 2016

Member

It seems the code is already there: jbevain/cecil@7cde491.

That code has been there since 31/7/2015 but OpenCover has been using the package 0.9.6.1 from 30/5/2015 [so the fix has not been available], however it seems that just yesterday 19/6/2016 a new package 0.9.6.3 was released; there was no 0.9.6.2.

So it looks like it was released just in time for us to address this feature.

Member

sawilde commented Jul 19, 2016

It seems the code is already there: jbevain/cecil@7cde491.

That code has been there since 31/7/2015 but OpenCover has been using the package 0.9.6.1 from 30/5/2015 [so the fix has not been available], however it seems that just yesterday 19/6/2016 a new package 0.9.6.3 was released; there was no 0.9.6.2.

So it looks like it was released just in time for us to address this feature.

@sawilde sawilde added this to the Release (Qn 2016) milestone Jul 19, 2016

@jp7677

This comment has been minimized.

Show comment
Hide comment
@jp7677

jp7677 Jul 22, 2016

Nice to read that! Looking forward to coverage reports over Dotnet Core C# and F# ;)

jp7677 commented Jul 22, 2016

Nice to read that! Looking forward to coverage reports over Dotnet Core C# and F# ;)

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Jul 23, 2016

Member

Unfortunate 0.9.6.3 does not work and the library is throwing an exception. Will try and investigate but it may not be trivial

Member

sawilde commented Jul 23, 2016

Unfortunate 0.9.6.3 does not work and the library is throwing an exception. Will try and investigate but it may not be trivial

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Jul 23, 2016

Member

Okay it seems the fix is in master for the next release (0.10.) but is not available for the 0.9.6. packages

Member

sawilde commented Jul 23, 2016

Okay it seems the fix is in master for the next release (0.10.) but is not available for the 0.9.6. packages

@jp7677

This comment has been minimized.

Show comment
Hide comment
@jp7677

jp7677 Jul 24, 2016

Thanks a lot for sharing you information. I would be happy to make some tests with C# and F# on dotnet core if you manage to release a pre-release on nuget based on the cecil pre-release.

jp7677 commented Jul 24, 2016

Thanks a lot for sharing you information. I would be happy to make some tests with C# and F# on dotnet core if you manage to release a pre-release on nuget based on the cecil pre-release.

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Jul 24, 2016

Member

I have a build available here - https://ci.appveyor.com/project/sawilde/opencover/build/4.6.589

The new mono.cecil is due in a week or so, so I'll probably wait for that before pushing out a new OpenCover package.

Member

sawilde commented Jul 24, 2016

I have a build available here - https://ci.appveyor.com/project/sawilde/opencover/build/4.6.589

The new mono.cecil is due in a week or so, so I'll probably wait for that before pushing out a new OpenCover package.

@jp7677

This comment has been minimized.

Show comment
Hide comment
@jp7677

jp7677 Jul 28, 2016

Hi there. good work! Using your appveyor build I could run my unit tests with portable pdb files and the coverage for C# was reported. Cool!

Unfortunately Opencover still complains about MissingPdb in an F# project with portable pdb's. Is there a way to get some more info from OpenCover about the actual reason? Or could I provide you a sample so that you can step through with a debugger? I could attach some binaries to this issue or alternatively you could take a look at https://github.com/jp7677/hellocoreclr, though the latest master doesn't yet has the "debugType": "portable" switch in the projects.json's.

jp7677 commented Jul 28, 2016

Hi there. good work! Using your appveyor build I could run my unit tests with portable pdb files and the coverage for C# was reported. Cool!

Unfortunately Opencover still complains about MissingPdb in an F# project with portable pdb's. Is there a way to get some more info from OpenCover about the actual reason? Or could I provide you a sample so that you can step through with a debugger? I could attach some binaries to this issue or alternatively you could take a look at https://github.com/jp7677/hellocoreclr, though the latest master doesn't yet has the "debugType": "portable" switch in the projects.json's.

@jp7677

This comment has been minimized.

Show comment
Hide comment
@jp7677

jp7677 Aug 1, 2016

FYI, updating Microsoft.FSharp.Core.netcore to 1.0.0-alpha-160727 makes no difference. Though of course still possible that the f# coverage issue is related to an issue in f# for .net core and not something within OpenCover.

jp7677 commented Aug 1, 2016

FYI, updating Microsoft.FSharp.Core.netcore to 1.0.0-alpha-160727 makes no difference. Though of course still possible that the f# coverage issue is related to an issue in f# for .net core and not something within OpenCover.

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Aug 1, 2016

Member

@jp7677 - A sample would be better as then I am testing the same thing as you are; always hard to replicate these things sometimes.

Member

sawilde commented Aug 1, 2016

@jp7677 - A sample would be better as then I am testing the same thing as you are; always hard to replicate these things sometimes.

@jp7677

This comment has been minimized.

Show comment
Hide comment
@jp7677

jp7677 Aug 1, 2016

@sawilde You could:

  • clone https://github.com/jp7677/hellocoreclr
  • run git checkout origin/portable-pdb
  • run dotnet restore
  • run dotnet test test/app.tests to validate that everything is fine.
  • run
    OpenCover.Console.exe -target:dotnet.exe -targetargs:"test test\app.tests" -register:user -filter:"+[HelloCoreClrApp*]* -[HelloCoreClrApp*.Tests*]*" -hideskipped:Filter -mergeoutput -output:reports\coverage-dotnet.xml
  • inspect the reports\coverage-dotnet.xml report. HelloCoreClrApp.dll (c#) is correctly covered, whereas HelloCoreClrApp.Rules.dll (f#) is not covered due to "MissingPdb".

Please let me know if above works for you or if I can help in a different way.

jp7677 commented Aug 1, 2016

@sawilde You could:

  • clone https://github.com/jp7677/hellocoreclr
  • run git checkout origin/portable-pdb
  • run dotnet restore
  • run dotnet test test/app.tests to validate that everything is fine.
  • run
    OpenCover.Console.exe -target:dotnet.exe -targetargs:"test test\app.tests" -register:user -filter:"+[HelloCoreClrApp*]* -[HelloCoreClrApp*.Tests*]*" -hideskipped:Filter -mergeoutput -output:reports\coverage-dotnet.xml
  • inspect the reports\coverage-dotnet.xml report. HelloCoreClrApp.dll (c#) is correctly covered, whereas HelloCoreClrApp.Rules.dll (f#) is not covered due to "MissingPdb".

Please let me know if above works for you or if I can help in a different way.

@jp7677

This comment has been minimized.

Show comment
Hide comment
@jp7677

jp7677 Dec 13, 2016

Hi @sawilde I have tested the portable pdb's i.c.w. C# and F# in Dotnet Core 1.1 again with your pre-release again. The C# code was already perfectly covered. It seems that coverage of F# sources is also correctly reported now. Dunno if its DotNet 1.1 or the latest versions of the F# packages for Dotnet Core, but its working now. Very cool ;)
Thus your pre-release with the Cecil beta works perfectly fine now for me for both C# and F#.

jp7677 commented Dec 13, 2016

Hi @sawilde I have tested the portable pdb's i.c.w. C# and F# in Dotnet Core 1.1 again with your pre-release again. The C# code was already perfectly covered. It seems that coverage of F# sources is also correctly reported now. Dunno if its DotNet 1.1 or the latest versions of the F# packages for Dotnet Core, but its working now. Very cool ;)
Thus your pre-release with the Cecil beta works perfectly fine now for me for both C# and F#.

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Dec 14, 2016

Member

Awesome - thanks for the update

Member

sawilde commented Dec 14, 2016

Awesome - thanks for the update

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Dec 22, 2016

Any idea when this will hit nuget.org?

onovotny commented Dec 22, 2016

Any idea when this will hit nuget.org?

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Dec 23, 2016

Member

nope - as I have said I am waiting on Mono.Cecil to come out of beta

Member

sawilde commented Dec 23, 2016

nope - as I have said I am waiting on Mono.Cecil to come out of beta

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Dec 23, 2016

Okay, any chance you can setup a MyGet feed so we can just reference that until then?

onovotny commented Dec 23, 2016

Okay, any chance you can setup a MyGet feed so we can just reference that until then?

@axelheer

This comment has been minimized.

Show comment
Hide comment
@axelheer

axelheer Dec 23, 2016

Yeah, or just a beta release on NuGet would be awesome. 🙏

axelheer commented Dec 23, 2016

Yeah, or just a beta release on NuGet would be awesome. 🙏

@onovotny

This comment has been minimized.

Show comment
Hide comment
@onovotny

onovotny Mar 8, 2017

With ppdb's one thing to note is that they can be embedded in the dll. They may not be a standalone dll.

dotnet/corefx@42422af

onovotny commented Mar 8, 2017

With ppdb's one thing to note is that they can be embedded in the dll. They may not be a standalone dll.

dotnet/corefx@42422af

@DaveEmmerson

This comment has been minimized.

Show comment
Hide comment
@DaveEmmerson

DaveEmmerson Mar 9, 2017

Until this is available does anyone have a workaround for F#? I can set DebugType full in a .csproj and it generates the windows .pdbs, but if I do the same for an .fsproj, no .pdb is produced at all :(

DaveEmmerson commented Mar 9, 2017

Until this is available does anyone have a workaround for F#? I can set DebugType full in a .csproj and it generates the windows .pdbs, but if I do the same for an .fsproj, no .pdb is produced at all :(

@jp7677

This comment has been minimized.

Show comment
Hide comment
@jp7677

jp7677 commented Mar 9, 2017

@DaveEmmerson

This comment has been minimized.

Show comment
Hide comment
@DaveEmmerson

DaveEmmerson Mar 10, 2017

@jp7677 thanks. The documentation on the F# side isn't quite right, so they're going to look at making it clear that they only do portable. Microsoft/visualfsharp#2565

I've used your method and it worked fine, cheers 👍

DaveEmmerson commented Mar 10, 2017

@jp7677 thanks. The documentation on the F# side isn't quite right, so they're going to look at making it clear that they only do portable. Microsoft/visualfsharp#2565

I've used your method and it worked fine, cheers 👍

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Apr 16, 2017

Member

Closing this issue as it is covered by #595

  • raised additional cards to track the other issues raised here
Member

sawilde commented Apr 16, 2017

Closing this issue as it is covered by #595

  • raised additional cards to track the other issues raised here
@manjushavnair

This comment has been minimized.

Show comment
Hide comment
@manjushavnair

manjushavnair Jan 4, 2018

Opencover not creating any profling information

  1. Visual Studio 2015
  2. .net 4.5
  3. Latest oepnover
  4. The msbuils target getting executed with our error , but getting a portable file issue
  5. coverage report file ,coverage history file ..etc getting created . But no content in the files execpet a few line

here is my target which gets executed with a issue stating that the portable is missing

manjushavnair commented Jan 4, 2018

Opencover not creating any profling information

  1. Visual Studio 2015
  2. .net 4.5
  3. Latest oepnover
  4. The msbuils target getting executed with our error , but getting a portable file issue
  5. coverage report file ,coverage history file ..etc getting created . But no content in the files execpet a few line

here is my target which gets executed with a issue stating that the portable is missing

@manjushavnair

This comment has been minimized.

Show comment
Hide comment
@manjushavnair

manjushavnair Jan 4, 2018

https://github.com/manjushavnair/MVCDOTNET/blob/master/MVCAppTests/MVCAppTests.csproj

I have my Target Name="CoverageOC" which works but shows an error that portable is missing

manjushavnair commented Jan 4, 2018

https://github.com/manjushavnair/MVCDOTNET/blob/master/MVCAppTests/MVCAppTests.csproj

I have my Target Name="CoverageOC" which works but shows an error that portable is missing

@sawilde

This comment has been minimized.

Show comment
Hide comment
@sawilde

sawilde Jan 5, 2018

Member

@manjushavnair please raise this as a new issue rather than hijack an old one - thanks

Member

sawilde commented Jan 5, 2018

@manjushavnair please raise this as a new issue rather than hijack an old one - thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment