Страница:
Incompatibilities between CoreCLR and Mono
Страницы
.NET 10 release notes
.NET 6
.NET 7 release notes
.NET 8 release notes
.NET 9 release notes
.NET daily
.NET release notes Xcode 13.3
.NET release notes Xcode 14.0
.NET release notes
.NET
BINDINGS
Breaking changes in .NET
Build & Run
Continuous Integration
Debugging Hints
Debugging Https bugs using Charles
Debugging on watchOS device
Diagnosis
FabricBot
Globalization
Home
How to Contribute
Incompatibilities between CoreCLR and Mono
Known issues in .NET
Known issues in .NET10
Known issues in .NET7
Known issues in .NET8
Known issues in .NET9
Labels and when to use them
Mac Catalyst (Early Preview)
Nullability
Obsolete
Profiling App Launch
Profiling
Project file properties dotnet migration
Project file properties
Submitting Bugs & Suggestions
Xcode Summer Expectations
d16 0 notes
release notes template
xcode102 notes
1
Incompatibilities between CoreCLR and Mono
Rolf Bjarne Kvinge редактировал(а) эту страницу 2022-05-10 11:52:30 +02:00
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 /
.
Example:
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 or Marshal.GetFunctionPointerForDelegate.
Example:
using System;
using System.Runtime.InteropServices;
class App {
public static void Main ()
{
Action<int> a = v => {};
var p = Marshal.GetFunctionPointerForDelegate (a);
Console.WriteLine (p);
}
}
Mono prints:
$ mcs Program.cs && mono Program.exe
4500559232
CoreCLR prints:
$ dotnet run
Unhandled exception. System.ArgumentException: The specified Type must not be a generic type. (Parameter 'delegate')
at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal(Delegate d)
at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(Delegate d)
at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate[TDelegate](TDelegate d)
at App.Main() in Program.cs:line 8
Ref: https://github.com/dotnet/runtime/issues/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 back into native code, 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.
Contributing
Bindings
- README
- xcode13.0 Binding Status
- xcode13.1 Binding Status
- xcode13.2 Binding Status
- xcode13.3 Binding Status
- xcode13.4 Binding Status
- xcode14.0 Binding Status
- xcode14.1 Binding Status
- xcode14.2 Binding Status
- xcode14.3 Binding Status
- xcode15.0 Binding Status
- xcode15.1 Binding Status
- xcode15.3 Binding Status
- xcode15.4 Binding Status
- xcode16.0 Binding Status
- xcode16.1 Binding Status
- xcode16.2 Binding Status