Skip to content
New issue

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

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

Already on GitHub? # to your account

Add additional net6.0 target framework #515

Merged
merged 5 commits into from
Jul 18, 2023
Merged

Conversation

ElektroKill
Copy link
Contributor

Fixes #514

This PR adds support net6.0 target for dnlib. The rationale for this change was discussed in the aforementioned issue and updates the NuGet packages used by dnlib to the latest available versions.

I've also gone ahead and replaced most of the usages of string concatenation and replaced it with string interpolation. This allows Roslyn to better take advantage of the faster string API's available in .NET 6. Some code changes were also necessary to resolve warnings regarding obsolete members and platform compatibility of the unmanaged Windows PDB support. A few NRE's which were picked up by code analysis were also fixed!

if (prevFunc is not null || prevFunc.Address != address)
if (prevFunc is not null && prevFunc.Address != address)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this was an unintentional mixup of the || and && operators which would result in right-hand side being executed only if prevFunc was null causing an NRE. If I'm wrong feel free to correct me.

Comment on lines -1498 to +1503
[HandleProcessCorruptedStateExceptions, SecurityCritical] // Req'd on .NET Framework 4.0
// Required attributes on .NET Framework 4.0
// HandleProcessCorruptedStateExceptions is obsolete on .NET Core and newer
#if !NETCOREAPP
[HandleProcessCorruptedStateExceptions]
#endif
[SecurityCritical]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone ahead and used conditional compilation here to exclude the HandleProcessCorruptedStateExceptions attribute as it is marked with Obsolete and the obsolescence message claims this attribute is ignored by the runtime. I have not verified this behavior. An alternative could be to use #pragma directive to disable the obsolescence warning and still include the attribute in the compiled code just in case it does actually make a difference.

@wtfsck wtfsck merged commit be1b313 into 0xd4d:master Jul 18, 2023
@wtfsck
Copy link
Contributor

wtfsck commented Jul 18, 2023

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider adding a net6.0 as an additional target framework
2 participants