View Single Post
Old 07-29-2008   #4 (permalink)
Thomas W. Brown


 
 

Re: XamlParseException -> System.Security exception

One slight clarification... There is actually another InnerException
available, with a slightly different stack trace:

at System.Security.CodeAccessSecurityEngine.Check(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at MS.Internal.PresentationFramework.SecurityHelper.DemandUnmanagedCode()
at System.Windows.Window..ctor()
at Test.Window1..ctor()

Perhaps this helps shed some light on this issue??

-- TB

"xYrus" wrote:
Quote:

> Could you try to upgrade to .NET 3.5
> (http://www.microsoft.com/downloads/d...displaylang=en)
> and try again?
>
> Ususally, you don't have to configure security parameters. But note that,
> when you do some local system action (e.g. deleting a file) in browser
> applications, you will get a security error.
>
> You can also get extended information about XAML parsing errory by executing
> the project via "F11" key (debug per line) and press F11 until the exception
> arrives. The highlighted line causes the error.
>
> If nothing helps, you could send me the sample code (e-mail in header) and I
> will check that in a new XPSP3 virtual machine.
>
> "Thomas W. Brown" <thomas_w_brown@xxxxxx> schrieb im
> Newsbeitrag news:3600C6A9-D357-4C83-9912-3381937D6740@xxxxxx
Quote:

> >I must be missing something obvious... I just installed VS 2008 on a new
> > laptop (running XP SP3) and am trying the most simple WPF application
> > (dropping a button onto the default grid. When I try to run I get an
> > XamlParseException error (Line 1, position 9) but the inner, inner
> > exception
> > is a security exception:
> >
> > {"Request for the permission of type
> > 'System.Security.Permissions.SecurityPermission, mscorlib,
> > Version=2.0.0.0,
> > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."}
> >
> > The stack trace is coming up through
> > System.Windows.Markup.BamlRecordReader.CreateInstanceFromType
> >
> > Is there some .NET Security configuration I've missed? The weird thing is
> > that on another machine I have no such problems and the .NET security
> > configuration on both appears to be the same.
> >
> > TIA
> > -- TB
> >
>
My System SpecsSystem Spec