mardi 1 mars 2016

Permissions issues with F# and Silverlight

I have a portable F# library targeting Silverlight 5 and .Net 4.5 (profile 47 to be specific). I'm attempting to use FSharpType and FSharpValue from Microsoft.FSharp.Reflection to handle some serialization of union and record types from another portable library, although this one is in C# and targeting the same portable profile. However, accessing these APIs from within my Silverlight app gives me a MethodAccessException, the top of whose call stack is below. I'm trying to determine if it's even possible to access these F# reflection APIs from a Silverlight 5.0 app.

System.MethodAccessException occurred
  HResult=-2146233072
  Message=Attempt to access method Microsoft.FSharp.Core.CompilationMappingAttribute..ctor(Microsoft.FSharp.Core.SourceConstructFlags) in violation of security transparency rules failed.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle.CheckLinktimeDemands(IRuntimeMethodInfo method, RuntimeModule module, Boolean isDecoratedTargetSecurityTransparent)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
       at System.RuntimeType.GetCustomAttributes(Boolean inherit)





Aucun commentaire:

Enregistrer un commentaire