Skip to content
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

Known breaking changes / differences in CoreCLR #10795

Closed
rolfbjarne opened this issue Mar 5, 2021 · 1 comment
Closed

Known breaking changes / differences in CoreCLR #10795

rolfbjarne opened this issue Mar 5, 2021 · 1 comment
Labels
documentation The issue or pull request is about documentation dotnet An issue or pull request related to .NET (6)
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Mar 5, 2021

This issue is to list all differences between MonoVM and CoreCLR.

Differences between legacy Xamarin and .NET 6+ (that happen for both MonoVM and CoreCLR) should be listed here: #8900

Assembly.GetType works differently for nested types

Mono accepts both + and / as the character that separates the declaring type and the nested type, while CoreCLR only accepts /.

Test case:

using System;

class Program
{
	class N {}
	static void Main (string[] args)
	{
		Console.WriteLine ($"Program+N: {typeof (Program).Assembly.GetType ("Program+N")}");
		Console.WriteLine ($"Program/N: {typeof (Program).Assembly.GetType ("Program/N")}");
	}
}

Mono prints:

$ mcs Program.cs && mono Program.exe
Program+N: Program+N
Program/N: Program+N

CoreCLR prints:

$ dotnet run
Program+N: Program+N
Program/N: 

It's not possible to pass an Action<T> or a Func<T> to a P/Invoke

Ref: dotnet/runtime#32963

It's not possible to have CoreCLR unwind native frames for managed exceptions.

This means that no entry point into managed code can "leak" exceptions, because CoreCLR will abort the process.

For Objective-C entry points, Xamarin will catch managed exceptions and convert them to Objective-C exceptions, but this won't be done for reverse P/Invokes in user code.

As a result, the UnwindNativeCode and UnwindManagedCode values for exception marshaling are not valid when using CoreCLR.

Ref: #11344

@rolfbjarne
Copy link
Member Author

@ghost ghost locked as resolved and limited conversation to collaborators Jun 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation The issue or pull request is about documentation dotnet An issue or pull request related to .NET (6)
Projects
None yet
Development

No branches or pull requests

1 participant