RefSafetyRulesAttribute - Runtime Exception
- Dominant language
- C#
- Stars
- 5.1k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
### Describe your question
I am writing a driver for a sandboxed environment that runs Mono and supports .NETFramework 472. The sandboxed platform loads our assembly which references MQTTNet Nuget `4.3.6.1152`. The platform uses a wrapped version of `System.Reflection` and upon calling `GetTypes()` on our assembly a `System. TypeLoadException: RestrictionViolationException: System.Runtime.CompilerServices.RefSafetyRulesAttribute - Not allowed due to restrictions` is thrown.
I've cloned the project and cannot find any usages of this attribute. I'm trying to figure out what might be causing this issue so I can build the project locally. Could anyone please offer any insight?
Thank you
### Which project is your question related to?
- Client
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the exception with MQTTNet NuGet 4.3.6.1152 on .NET Framework 4.7.2, focusing on the wrapped System.Reflection GetTypes() call and the reported RefSafetyRulesAttribute restriction. Compare the cloned project and built assembly metadata to determine where the attribute is introduced and whether the sandbox rejects the resulting assembly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100