Ok, enough detective work turned up the need, on this installation at least,
to explicitly set the Security settings for this project to "Enable ClickOnce
Security Settings" where the option for full trust application was already
selected. Once I did this, I can run even the vanilla app created for a
blank WPF Application in VS2008 without encountering the error.
Still a mystery, though, is why, on my other machine, do I not need to do
this? Why is the "WPF Application" wizard code, on my new laptop
installation, trying to run in the sandbox? The project is set to build a
Windows Application.
-- TB
"Thomas W. Brown" wrote:
> 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
>