I had similar problem. Installed VS2008 and made a little test app with few
buttons. I had same exception - line 1 character 9 thingy.
I started to comment out C# code line by line and then found that some very
simple code in Windows1 constructor was the cause of the exception in
run-time.
I had to move it into OnIntitalize and it works since that. I still dont
know why it was heppening though as the code did compile fine and looked
pretty legitimate.
I just wonder - how much real PITA this 'nice' separation (XAML from
code-behind) is going to bring into development processes in big projects
within big teams. Especially if 'designers' will be in charge of XAML and
'developers' - of C# code-behind.
"Thomas W. Brown" wrote:
Quote:
> O...M...G...,
>
> Ok, I finally realized that this laptop was setup to redirect "My Documents"
> to a mapped network drive. So, the default location for new projects was on
> a network share instead of the local hard drive. I was essentially getting
> the same error one gets when trying to run a .NET Forms application from a
> network share, just very much disguised!!!
>
> It will be nice to see the next round of improvements in the IDE for working
> with XAML and WPF projects!!!!!!!
>
> -- TB
>
> "Thomas W. Brown" wrote:
> 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
> >