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
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