Multimobile Development: Building Applications for any Smartphone
Receving... System.ArgumentException: Invalid Xml in EnterpriseInstrumentation
Messages   Related Types
This message was discovered on microsoft.public.vsnet.enterprise.tools.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Tim Reynolds
I am using MS Logging code block. Today, I made some changes to an .xslt formatter file. Apparently at one point I typoed in the XSLT and received an exception upon which I recreated the file. In anycase I am getting a strange result. In web.config file I provided the formatter name and specify the value of fullyQualifiedDefaultXsltPath="eventlogtransform.xslt"/> . It gets this from my C:\WINNT\System32 directory. I confirmed this by removing it and got an IO exception looking for file there.

However, now EIF always throws this message when using this file now:
Event Type:    Error
Event Source:    Enterprise Instrumentation
Event Category:    None
Event ID:    0
Date:        4/23/2004
Time:        12:19:09 PM
User:        N/A
Computer:    CUSFLTTPSTC0UH8
Description:
System.ArgumentException: Invalid Xml.
at System.Security.Policy.PolicyStatement.FromXml(SecurityElement et, PolicyLevel level)
at System.Security.Policy.PolicyLevel.CheckCache(Int32 count, Char[] serializedEvidence, Boolean& xmlError)
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(String url, XmlResolver resolver)
at System.Xml.Xsl.XslTransform.Load(String url)
at Microsoft.ApplicationBlocks.Logging.EventSinks.XsltCacheEntry..ctor(String xsltFile)
at Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter.Format(XPathDocument eventInformationToFormat, Stream serializationStream)
at Microsoft.ApplicationBlocks.Logging.EventSinks.BaseSink.Format(Object eventToFormat)
at Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink.Write(Object eventToRaise)
at Microsoft.EnterpriseInstrumentation.EventSource.RaiseEvent(Object eventToRaise, RequestContext requestContext)

However, if I simply rename the file to say eventlogtransform2.xslt (in WINNT\System32) and then modify my Web.config file to: fullyQualifiedDefaultXsltPath="eventlogtransform2.xslt", it works fine. The formatter is used properly. If I take the file and move it to my C drive (root) and specify fullyQualifiedDefaultXsltPath="C:\eventlogtransform.xslt" (leaving the name eventlogtransform), it works fine. These test tell me that there is nothing wrong with the .xslt - as it works fine with either a different file name or a different location! For some strange reason though, when it reads it from WINNT\System32, I receive the exception. It's like it has a cache for the file. I have rebooted my PC twice trying to clear the cache out. I need to retain the same file name eventlogtransform.xslt and need it to be in C:\WINNT\System32.

Please help.

Here is my XSLT contents (copy/paste):
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; xmlns:event="urn:2B9EF1B7-CBEC-4da3-9443-BF4C701DAEA7" exclude-result-prefixes="event"><xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/><!--
    This xslt file is for filtering out unnecessary name/value pairs from event
    data and only writing to the event log and/or basic sql log these properties:
    Message
    StackTrace
    Severity
    TimeStamp
    Operation
    Reason
    If wishing to send other types of events to the event log and/or basic sql log,
    then please add type as well as any other properties you wish to display -
    
    adding for dev team....
    MachineName (all)
    WindowsSecurity.CurrentAccountName (error)
    WindowsSecurity.IdentityName (error)
    CurrentAccountName (audit)
    IdentityName (audit)
    --><xsl:template match="/"><Log><xsl:apply-templates/></Log></xsl:template><xsl:template match="event:NameValuePair[@name='Message']"><xsl:attribute name="Message"><!-- <xsl:value-of select="substring(@value,1,80)"/> This strips first 80 bytes of message--><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='StackTrace']"><xsl:attribute name="StackTrace"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='EventId']"><xsl:attribute name="EventId"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='Severity']"><xsl:attribute name="Severity"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='TimeStamp']"><xsl:attribute name="TimeStamp"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='Operation']"><xsl:attribute name="Operation"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='Reason']"><xsl:attribute name="Reason"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='MachineName']"><xsl:attribute name="MachineName"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='WindowsSecurity.CurrentAccountName']"><xsl:attribute name="WindowsSecurity.CurrentAccountName"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='WindowsSecurity.IdentityName']"><xsl:attribute name="WindowsSecurity.IdentityName"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='CurrentAccountName']"><xsl:attribute name="CurrentAccountName"><xsl:value-of select="@value"/></xsl:attribute></xsl:template><xsl:template match="event:NameValuePair[@name='IdentityName']"><xsl:attribute name="IdentityName"><xsl:value-of select="@value"/></xsl:attribute></xsl:template></xsl:stylesheet>

Here is a good event log message using the formatter when it was in C root on an audit message event:
Event Type:    Information
Event Source:    VOSE Web Services Incoming
Event Category:    None
Event ID:    0
Date:        4/23/2004
Time:        12:17:25 PM
User:        N/A
Computer:    CUSFLTTPSTC0UH8
Description:
<Log Message="GetAllWorkStation was called. The parameters are Company=S EmployeeId=T3ITDR1" IdentityName="" CurrentAccountName="US1\CUSFLTTPSTC0UH8$" EventId="a313b0ea-59ab-4b77-8c8c-a3438383a0bf" TimeStamp="4/23/2004 4:17:25 PM" MachineName="CUSFLTTPSTC0UH8"></Log>

Please help.

Thanks,
Tim Reynolds
Verizoin

Reply to this message...
Vote that this is a GOOD answer...
 
Really good experience at the Apple Store
MonoDroid – looking *awesome*
 
    
Gary Chang (VIP)
Hi Tim,

Currently I am looking for somebody who could help you on it. We will reply
here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Tian Min Huang (VIP)
Hello Verizoin,

Thanks for your post. Based on my experience, this problem may be the
result of corruption in your security cache. Please perform the following
steps to force the security policy and cache to be purged.

.NET Framework security keeps a cache in the following location:

C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\config

These are the 2 files:

? security.config.cch
? enterprisesec.config.cch

We just deleted both of these and ran:

caspol -all -reset

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Tim Reynolds
I deleted both the files and ran the command. At the prompt issued I select yes to continue. I retried my test, and IEF still received the exception:Event Type:    Error
Event Source:    Enterprise Instrumentation
Event Category:    None
Event ID:    0
Date:        4/26/2004
Time:        9:24:44 AM
User:        N/A
Computer:    CUSFLTTPSTC0UH8
Description:
System.ArgumentException: Invalid Xml.
at System.Security.Policy.PolicyStatement.FromXml(SecurityElement et, PolicyLevel level)
at System.Security.Policy.PolicyLevel.CheckCache(Int32 count, Char[] serializedEvidence, Boolean& xmlError)
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(String url, XmlResolver resolver)
at System.Xml.Xsl.XslTransform.Load(String url)
at Microsoft.ApplicationBlocks.Logging.EventSinks.XsltCacheEntry..ctor(String xsltFile)
at Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter.Format(XPathDocument eventInformationToFormat, Stream serializationStream)
at Microsoft.ApplicationBlocks.Logging.EventSinks.BaseSink.Format(Object eventToFormat)
at Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink.Write(Object eventToRaise)
at Microsoft.EnterpriseInstrumentation.EventSource.RaiseEvent(Object eventToRaise, RequestContext requestContext)

(Also - some more info - I also sent the eventlogtransform.xslt to a coworker who put in his c:\winnt\system32 file and it worked fine. So not only does it work fine on my pc when in antoher location or name - but works fine in a coworkers pc with as c:\winnt\system32\eventlogtransform.xslt)

What else do you need to troubleshoot?

Thanks,
Tim Reynolds

Reply to this message...
Vote that this is a GOOD answer...
 
First volume of Multimobile Development nearly ready to go to press
A mention on Developing for the iPhone and Android: The pros and cons
 
    
Barath Vasudevan [MS] (VIP)
Hi Tim,

I belive that XML or XSLT files are not cached in any specific folder/file.
They are loaded into the memory for the time the processing needs to be
done. However if the XML DOM is used then files could be cached in the
browser cache or Temp Internet Files directory.

It is pretty weird that even a reboot has not cleared the error if the XML
files are cached in memory. I'll look into this further and update you if
I find any causes, in a couple of days.

Thx

Barath
This posting is provided "As Is" with no warranties, and confers no
rights.Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

--------------------
>Thread-Topic: Receving... System.ArgumentException: Invalid Xml in
EnterpriseInstrumentation
[Original message clipped]

exception:Event Type:    Error
Event Source:    Enterprise Instrumentation
Event Category:    None
Event ID:    0
Date:        4/26/2004
Time:        9:24:44 AM
User:        N/A
Computer:    CUSFLTTPSTC0UH8
Description:
System.ArgumentException: Invalid Xml.
at System.Security.Policy.PolicyStatement.FromXml(SecurityElement et,
PolicyLevel level)
at System.Security.Policy.PolicyLevel.CheckCache(Int32 count, Char[]
serializedEvidence, Boolean& xmlError)
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(String url, XmlResolver resolver)
at System.Xml.Xsl.XslTransform.Load(String url)
at
Microsoft.ApplicationBlocks.Logging.EventSinks.XsltCacheEntry..ctor(String
xsltFile)
at
Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter.Format(XPa
thDocument eventInformationToFormat, Stream serializationStream)
at Microsoft.ApplicationBlocks.Logging.EventSinks.BaseSink.Format(Object
eventToFormat)
at
Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink.Write(Object
eventToRaise)
at Microsoft.EnterpriseInstrumentation.EventSource.RaiseEvent(Object
eventToRaise, RequestContext requestContext)

(Also - some more info - I also sent the eventlogtransform.xslt to a
coworker who put in his c:\winnt\system32 file and it worked fine. So not
only does it work fine on my pc when in antoher location or name - but
works fine in a coworkers pc with as
c:\winnt\system32\eventlogtransform.xslt)

What else do you need to troubleshoot?

Thanks,
Tim Reynolds

>

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Barath Vasudevan [MS] (VIP)
Tim,

I have not been able to find any location/cause for the transform file to
be cached. Did you have any luck rectifying the problem after deleting the
browser cache?

Thx
Barath
This posting is provided "As Is" with no warranties, and confers no
rights.Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

--------------------
[Original message clipped]

<Click here to reveal e-mail address>
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Tim Reynolds
No, have not been able to rectify the problem by deleting the web cache, reboot, or otherwise....

Still need help.
Thanks,
Tim
Reply to this message...
Vote that this is a GOOD answer...
 
First chapters of Multimobile Development book now available on Apress Alpha program
iPad
 
    
Barath Vasudevan [MS] (VIP)
Ok.
I was NOT able to reproduce the "caching" behavior that you are seeing with
the FormattingSample available with LAB. "Caching" does take place, but
only for the period when the application is alive; so rebooting/restarting
the app should have cleared the "cache".

In light of the above information, i have few questions

a. Is the application you can repro the behavior with a console/webapp? (i
know you have mentioned web.config so i assume it is a web app....)
b. Where is your app installed and where is the web.config file located?
c. can you also try using the Filemon utility from
http://www.sysinternals.com/ntw2k/source/filemon.shtml to see where the
"cached" eventlogtransform.xslt is loaded from?

Let us know the results...
Thx
Barath
This posting is provided "As Is" with no warranties, and confers no
rights.Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

--------------------
>Thread-Topic: Receving... System.ArgumentException: Invalid Xml in
EnterpriseInstrumentation
[Original message clipped]

<Click here to reveal e-mail address>
<Click here to reveal e-mail address>
<k5w#Click here to reveal e-mail address>
>Subject: RE: Receving... System.ArgumentException: Invalid Xml in
EnterpriseInstrumentation
[Original message clipped]


Still need help.
Thanks,
Tim
>

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Jon Spokes
Hi- I've been having exactly the same problem, I'm working in a team of four developers, we all have the same setup & paths, getting our files from SourceSafe.
Only one machine gets the error, I've tried deleting internet files, clearing the history & rebuilding the .cch files. nothing worked.

The only solution I have is to rename the projects folder. Once I'd reset the virtual folder to point to the new location everything works.

--------------------------------
From: Jon Spokes
Reply to this message...
Vote that this is a GOOD answer...
 
 
    
victor kort
(Type your message here)

--------------------------------
From: victor kort

Hi i'm having exact the same problem, it suddely appeared.
Please help.
thanks for any suggestions.
vic

Invalid Xml.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Invalid Xml.

Source Error:

Line 149:
Line 150:                tr = new XslTransform();
Line 151:                tr.Load(path);
Line 152:
Line 153:                Cache.Insert("menutransform", tr, new System.Web.Caching.CacheDependency(path));

Source File: c:\inetpub\wwwroot\bba_informatiesysteem_1\menus\bbaleftmainmenu.aspx.cs Line: 151

Stack Trace:

[ArgumentException: Invalid Xml.]
System.Security.Policy.PolicyStatement.FromXml(SecurityElement et, PolicyLevel level) +570
System.Security.Policy.PolicyLevel.CheckCache(Int32 count, Char[] serializedEvidence, Boolean& xmlError) +164
System.Security.Policy.PolicyLevel.Resolve(Evidence evidence, Int32 count, Char[] serializedEvidence) +54
System.Security.PolicyManager.Resolve(Evidence evidence, PermissionSet request) +147
System.Security.SecurityManager.ResolvePolicy(Evidence evidence) +133
System.Xml.Xsl.Compiler.Compile(NavigatorInput input, XmlResolver xmlResolver, Evidence evidence) +372
System.Xml.Xsl.XslTransform.Compile(XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence) +215
System.Xml.Xsl.XslTransform.Load(String url, XmlResolver resolver) +195
System.Xml.Xsl.XslTransform.Load(String url) +26
BBA.BHG.Web.leftmainmenu.GenerateMenu(BhgGebruiker gebruiker) in c:\inetpub\wwwroot\bba_informatiesysteem_1\menus\bbaleftmainmenu.aspx.cs:151
BBA.BHG.Web.leftmainmenu.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\bba_informatiesysteem_1\menus\bbaleftmainmenu.aspx.cs:198
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Reply to this message...
Vote that this is a GOOD answer...
 
New book project – Multimobile Development: Building Applications for any Smartphone
Dive into HTML5
 
    
victor kort
(Type your message here)

--------------------------------
From: victor kort

Hi i'm having exact the same problem, it suddely appeared.
Please help.
thanks for any suggestions.
vic

Invalid Xml.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Invalid Xml.

Source Error:

Line 149:
Line 150:                tr = new XslTransform();
Line 151:                tr.Load(path);
Line 152:
Line 153:                Cache.Insert("menutransform", tr, new System.Web.Caching.CacheDependency(path));

Source File: c:\inetpub\wwwroot\bba_informatiesysteem_1\menus\bbaleftmainmenu.aspx.cs Line: 151

Stack Trace:

[ArgumentException: Invalid Xml.]
System.Security.Policy.PolicyStatement.FromXml(SecurityElement et, PolicyLevel level) +570
System.Security.Policy.PolicyLevel.CheckCache(Int32 count, Char[] serializedEvidence, Boolean& xmlError) +164
System.Security.Policy.PolicyLevel.Resolve(Evidence evidence, Int32 count, Char[] serializedEvidence) +54
System.Security.PolicyManager.Resolve(Evidence evidence, PermissionSet request) +147
System.Security.SecurityManager.ResolvePolicy(Evidence evidence) +133
System.Xml.Xsl.Compiler.Compile(NavigatorInput input, XmlResolver xmlResolver, Evidence evidence) +372
System.Xml.Xsl.XslTransform.Compile(XPathNavigator stylesheet, XmlResolver resolver, Evidence evidence) +215
System.Xml.Xsl.XslTransform.Load(String url, XmlResolver resolver) +195
System.Xml.Xsl.XslTransform.Load(String url) +26
BBA.BHG.Web.leftmainmenu.GenerateMenu(BhgGebruiker gebruiker) in c:\inetpub\wwwroot\bba_informatiesysteem_1\menus\bbaleftmainmenu.aspx.cs:151
BBA.BHG.Web.leftmainmenu.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\bba_informatiesysteem_1\menus\bbaleftmainmenu.aspx.cs:198
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Reply to this message...
Vote that this is a GOOD answer...
 
Steve Jobs’ thoughtful/thought provoking Thoughts on Flash…
Handy list of countries in CSV format
 
 
System.ArgumentException
System.Diagnostics.StackTrace
System.EventArgs
System.Security.PermissionSet
System.Security.Policy.PolicyLevel
System.Security.Policy.PolicyStatement
System.Security.SecurityElement
System.Security.SecurityManager
System.Web.Caching.Cache
System.Web.Caching.CacheDependency
System.Web.UI.Control
System.Web.UI.Page
System.Xml.XmlResolver
System.Xml.XPath.XPathDocument
System.Xml.XPath.XPathNavigator
System.Xml.Xsl.XslTransform




Multimobile Development: Building Applications for any Smartphone
Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734