Closed msedi closed 2 years ago
I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.
Is there a workaround to use it?
namespace System.Reflection {
static class MethodImplAttributes2 {
public const MethodImplAttributes AggressiveOptimization =
(MethodImplAttributes)0x0200;
}
}
@0xd4d: Thanks, I was assuming that this could to the trick. Did you try? The last time I was doing this was FileOptions. The constructor of FileStream checked the validity and threw an InvalidEnumException.
Closing as not planned, as .NET Standard is considered complete.
@0xd4d: Thanks, I was assuming that this could to the trick. Did you try? The last time I was doing this was FileOptions. The constructor of FileStream checked the validity and threw an InvalidEnumException.
This attribute an enum will be interpreted by the runtime. I believe the runtime will simply ignore unknown bits, but I think this puts you in undefined behavior territory.
Most of our components are developed in .NET Standard 2.0. With the advent of .NET Core 3.0 MethodImplOptions.AggressiveOptimization was introduced. So we have decided to swithc to .NET Standard 2.1 and were assuming the AggressiveOptimization is available too, but it isn't.