Evidence bug?

T

Tod Johnson

Not so long I've found really strange bug in the .NET. It seems that
Evidence that I've got from the current executing Assembly is somehow
expired (it happens suddenly after about month) and Xslt Transformation
stop working at all for the whole AppDomain until I restart it. Am I
using "this.GetType().Assembly.Evidence" incorrectly? And another
question is what if I pass Evidence that I've created using
CreateEvidenceForUrl(@"my working directory")? What is the diference
between this evidence and evidence that I've retrieved from Assembly
(this.GetType().Assembly.Evidence)?

Here is the code snippet:

XslTransform xt = new XslTransform();
try
{
xt.Load(new XmlTextReader(stream), null,
this.GetType().Assembly.Evidence);
}
catch(XsltCompileException ex)
{
throw new Exception(Utils.ExceptionsToString(ex), ex);
}

And here is the stacktrace:

Exception: System.Security.Cryptography.CryptographicException
Message: The parameter is incorrect.
Source: mscorlib
at System.Security.Policy.PolicyLevel.GenericResolve(Evidence
evidence, Boolean& allConst)
at System.Security.Policy.PolicyLevel.Resolve(Evidence evidence,
Int32 count, Char[] serializedEvidence)
at System.Security.PolicyManager.Resolve(Evidence evidence,
PermissionSet request)
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence)
at System.Xml.Xsl.Compiler.Compile(NavigatorInput input, XmlResolver
xmlResolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Compile(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Load(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence)
at System.Xml.Xsl.XslTransform.Load(XmlReader stylesheet,
XmlResolver resolver, Evidence evidence)

Thanks in advance,
Tod
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top