locked
Resolve security exception when exploring math.net library

    Question

  • When I applied the current version of Pex to explore the Math.NET library, I got the following exceptions when Pex tried to create an object of type 
    AkimaSplineInterpolation. Before I upgraded Pex, Pex used to be able to explore MathDotNet. Could you please tell me how I can resolve this security exception so that Pex can generate meaningful test inputs? I paste the exception trace as below:
    System.Security.SecurityException: Request failed.
       at MathNet.Numerics.Interpolation.Algorithms.CubicHermiteSplineInterpolation..ctor()
       at MathNet.Numerics.Interpolation.Algorithms.AkimaSplineInterpolation..ctor()
       at MathNet.Numerics.Interpolation.Algorithms.AkimaSplineInterpolationFactory.Create()
       at Microsoft.ExtendedReflection.__DynamicMethods.invoke:MathNet.Numerics.Interpolation.Algorithms.AkimaSplineInterpolationFactory.Create(ITermConstructor`1 , ITermDestructor`1 , Term[] )
       at Microsoft.Pex.Engine.PathExecution.PathExecutorBase.InternalRun(ITermDestructor`1 destructor, PathSegmentPreparer segmentPreparer, PathSegmentReporter segmentReporter, IEnumerable`1 segments)
       at Microsoft.Pex.Engine.PathExecution.PathExecutorBase.TryRun(PexPathExecutionResult& runResult, ISubstitution& finalSubstitution, IState& finalState)
    The action that failed was:
    Demand
    The type of the first permission that failed was:
    System.Security.PermissionSet
    The demand was for:
    <PermissionSet class="System.Security.PermissionSet"
    version="1"
    Unrestricted="true"/>
    The granted set of the failing assembly was:
    <PermissionSet class="System.Security.PermissionSet"
    version="1">
    <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Flags="SkipVerification, Execution"/>
    </PermissionSet>
    The refused set of the failing assembly was:
    <PermissionSet class="System.Security.PermissionSet"
    version="1">
    <IPermission class="System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    <IPermission class="System.Security.Permissions.ReflectionPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    <IPermission class="System.Security.Permissions.RegistryPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    <IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Flags="Assertion, UnmanagedCode, BindingRedirects"/>
    <IPermission class="System.Net.SocketPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    <IPermission class="System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    <IPermission class="System.Net.DnsPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    <IPermission class="System.Net.Mail.SmtpPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    <IPermission class="System.Net.NetworkInformation.NetworkInformationPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    version="1"
    Unrestricted="true"/>
    </PermissionSet>
    The assembly or AppDomain that failed was:
    MathNet.Iridium, Version=1.0.0.39870, Culture=neutral, PublicKeyToken=null
    The Zone of the assembly that failed was:
    MyComputer
    The Url of the assembly that failed was:
    file:///F:/CleanBenchmarks/MathNet.Iridium-2008.8.16.470/MathNet.Iridium-2008.8.16.470/Sources/MathNet.Iridium.Pex.Tests/bin/Debug/MathNet.Iridium.DLL

    Tuesday, April 12, 2011 5:14 AM