Skip to content

Conversation

@rladuca
Copy link
Member

@rladuca rladuca commented Dec 11, 2019

Fixes #2298

Use a set of matched, private IL tools in order to inject a module constructor into PresentationCore. These are copied binaries from a .NET Framework 4.7.2 installation and SDK.

Also fixing some issues with utilizing ILAsm outside of the installed Framework directory and some bugs that went unnoticed in our injection targets.

Pending

  • IL comparison between PresentationCore from this change and current .NET 5.0 PresentationCore.

…et of matched tools (from .NET 4.7.2) so that we can always ensure round-tripping works and we do not need to require .NET Framework SDKs to be installed.
…r that needs it. This allows ILAsm to properly create the module reference without inference (which fails for private tools not run from Framework installations).
@ghost ghost requested a review from vatsan-madhavan December 11, 2019 18:36
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Dec 11, 2019
@ghost ghost requested a review from SamBent December 11, 2019 18:36
@rladuca rladuca self-assigned this Dec 11, 2019
@rladuca rladuca added this to the 5.0 milestone Dec 11, 2019
@vatsan-madhavan
Copy link
Member

You have to undo @SamBent's documentation update.

@vatsan-madhavan
Copy link
Member

Instead of inventing new targets for ILAsm/ILDasm, you can reuse those supplied by Microsoft.NET.Sdk.IL.targets that comes as part of Microsot.NET.Sdk.il package, and override ILAsmToolPath ?

As long as the commandline usage have remained largely compatible between .NET Framework and .NET Core versions of ILAsm/ILDasm, I suspect that this would be doable.

@rladuca
Copy link
Member Author

rladuca commented Dec 11, 2019

Instead of inventing new targets for ILAsm/ILDasm, you can reuse those supplied by Microsoft.NET.Sdk.IL.targets that comes as part of Microsot.NET.Sdk.il package, and override ILAsmToolPath ?

As long as the commandline usage have remained largely compatible between .NET Framework and .NET Core versions of ILAsm/ILDasm, I suspect that this would be doable.

I don't think those targets are fully featured. While you can override the IL(D)AsmDir properties to choose non-package based tools, it seems there is only a target to decompile resources and a target to compile an IL file. They also don't accept some switches that we use. Generally, they seem created for a specific purpose and not for general use unless I am missing something.

@vatsan-madhavan
Copy link
Member

Generally, they seem created for a specific purpose and not for general use

😞

@rladuca
Copy link
Member Author

rladuca commented Dec 11, 2019

IL comparison seems fine, no major differences there between corresponding release DLLs.

…rence then module initializer. In cases where there is an existing mscorlib reference, we just replace it with the combined ref + initializer.
@rladuca rladuca merged commit 928fb9d into dotnet:master Dec 11, 2019
@rladuca rladuca deleted the privateiltools branch December 11, 2019 23:09
@ghost ghost locked as resolved and limited conversation to collaborators Apr 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dependency on .NET SDK installs for IL Tools

3 participants