-
-
Notifications
You must be signed in to change notification settings - Fork 990
InProcessNoEmitToolchain + NativeAOT Support? #2701
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
Comments
Can you use the string-based ctor of the attribute? https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.dynamicdependencyattribute.-ctor?view=net-9.0#system-diagnostics-codeanalysis-dynamicdependencyattribute-ctor(system-string-system-string-system-string) Either way, it would be good to have all of the types for that toolchain properly annotated for AOT consumption. Accepting PRs. |
It doesn't seem to work. I don't know if I am doing it correctly. [DynamicDependency(DynamicallyAccessedMemberTypes.All, "BenchmarkDotNet.Toolchains.InProcess.NoEmit.InProcessNoEmitRunner+Runnable", "BenchmarkDotNet")] I also tried another workaround, to copy code from
|
You could also try to disable trimming. |
NativeAOT doesn't allow to disable trimming. |
In my case my functions are not in the realm of nanoseconds so I can wrap around my results with |
I have the same use cases as #2694 to benchmark the same binary on different machines.
I use this config object:
However, when running a published NativeAOT (.NET 9.0.2) executable, I get:
I see
BenchmarkDotNet.Toolchains.InProcess.NoEmit.InProcessNoEmitRunner+Runnable
is a private class https://github.com/dotnet/BenchmarkDotNet/blob/master/src/BenchmarkDotNet/Toolchains/InProcess/NoEmit/InProcessNoEmitRunner.cs so I can'tuse
DynamicDependencyAttribute
to keep the class from being trimmed.The text was updated successfully, but these errors were encountered: