DotNET-Assembly-Grapher icon indicating copy to clipboard operation
DotNET-Assembly-Grapher copied to clipboard

Add support for .NET Core.

Open macrogreg opened this issue 4 years ago • 3 comments

Hi folks,

Thank you for the tool! I found it very useful.

One challenge that I had while using it, was that it did not support .NET Core. As a result, the tool was not able to "understand" assemblies that are part of the Core Framework, and marked them as "not found" even if they are an integral part of the Core Fx and are present in the expected folders.

To address that, I modified the project files to support a .NET Core 3.1 build target. Now, you can run the version targeting the "traditional" .NET Framework to analyze binaries that are targeting it, and - respectively - run the version targeting .NET Core to analyze binaries that target that flavor.

Hopefully, this will be useful to you and all your users.

Thank you!

macrogreg avatar Sep 23 '20 06:09 macrogreg

@tongbong @Quentin-Pouvreau @mengelagi @ChristopheCaffy @GuillaumeLebeau please take note :)

macrogreg avatar Sep 23 '20 20:09 macrogreg

Hi @macrogreg,

Thanks for your PR, we already have a branch named 'sdk-style' with contains migration of Csproj file to new SDK-Style. To avoid conflict I have taken your changes into account and added the .NET Core 3.1 as a target framework.

Can you try the version on the branch 'sdk-style' and tell me if it works as expected?

Thanks for your contribution.

GuillaumeLebeau avatar Sep 24 '20 07:09 GuillaumeLebeau

Hi @GuillaumeLebeau ,

Thanks for following up! I built the 'sdk-style' branch and I got the 2 binaries targeting Net Fx 4.7.2 and Net Core 3.1 as expected. I test by analyzing a recent DiagnosticSource release (DS).

First, I run the DotNET-Assembly-Grapher targeting Net Fx.

When I load the DS that targets Net Fx 4.5, I see what I expect to see: image

However, when I try loading the DS assembly that targets Net Std 1.3, I get an error: image

When I try loading DS that targets Net 5, I get this: image

This is what I expected. The loading works, but DotNET-Assembly-Grapher cannot find the libraries. This should be better when using the DotNET-Assembly-Grapher targeting Net Core. Next, I try that:

Loading DS that targets Net Fx 4.5: image

Loading DS that targets Net Std 1.3: image

Loading DS that targets Net 5: image

In all of the above I select Don't exclude .NET assemblies In the Specification Window dialog.

So it looks like there is trouble with the Net Core version. Notably, when I used the tool earlier, I was analyzing a different assembly, so not sure if the current issues existed there as well.

Hope, this helps! :)

macrogreg avatar Sep 29 '20 20:09 macrogreg