<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">Does this only happen in debug mode? Do you have a class or a method named like Mountains.filtered.set (in other words do you have any idea of what this
code is)? Or are you maybe deriving from a class named Mountains which has a set method?
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">Ultimately what I’m getting at is it’d be good to run this on the desktop CLR and get the same method created. So if you can isolate the code then run it
on the desktop you could run w/ the –X:SaveAssemblies option. That will write out the IL we generate to disk as a Snippets.scripting.dll and then you can run peverify on that and see if the generated code is actually unverifiable (or if maybe there’s a CLR
bug related to verification).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D">If there is actually unverifiable code then we have a bug we need to fix. If we have verifiable code or some difference between when we’re using RefEmit
and DynamicMethods then maybe the CLR has a bug that needs to be fixed.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext">From:</span></b><span style="font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext"> users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com]
<b>On Behalf Of </b>Lukas Cenovsky<br>
<b>Sent:</b> Friday, September 03, 2010 9:04 AM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Silverlight - Cannot save value from target back to source<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am trying to debug this bug and I need some help.<br>
<br>
I have built IronPython 2.6.1 - Silverlight debug binaries. I have pointed VS 2010 symbols folder to the folder with these binaries.<br>
<br>
I run the Silverlight app in the debug mode (debug=true in index.html), attach VS 2010 debugger, select Thrown for
<i>Common Language Runtime Exceptions</i> and <i>Managed Debugging Assistants</i> in Debug - Exceptions dialog.<br>
<br>
All symbols are loaded, so I click on the checkbox button on the page. The following exception occurs:<br>
<br>
<tt><span style="font-size:10.0pt">System.Security.VerificationException occurred</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt> Message=Operation could destabilize the runtime.</tt><br>
<tt> StackTrace:</tt><br>
<tt> at Mountains.filtered(Nullable`1 value)</tt><br>
<tt> InnerException: </tt></span><br>
<br>
No source available.This is the Call stack:<br>
<br>
<tt><span style="font-size:10.0pt">> Snippets.scripting!Mountains.filtered.set(bool? value) + 0x23 bytes
</span></tt><span style="font-size:10.0pt;font-family:
"Courier New""><br>
<tt> [Native to Managed Transition] </tt><br>
<tt> [Managed to Native Transition] </tt><br>
<tt> System.Windows.dll!System.Windows.CLRPropertyListener.Value.set(object value) + 0x23 bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.PropertyAccessPathStep.Value.set(object value) + 0x10 bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValue() + 0x3b2 bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValueIfNecessary() + 0x27 bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.Data.BindingExpression.TargetPropertyChanged(System.Windows.DependencyObject sender, System.Windows.DependencyProperty dp) + 0x2b bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyProperty dp) + 0x17 bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyProperty dp) + 0x51 bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.DependencyObject.RaisePropertyChangeNotifications(System.Windows.DependencyProperty dp, object oldValue, object newValue) + 0x5c bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.DependencyProperty property, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, System.Windows.DependencyObject.ValueOperation
operation) + 0xf6 bytes </tt><br>
<tt> System.Windows.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty dp, object value, bool allowReadOnlySet) + 0x1da bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.Controls.Primitives.ToggleButton.OnToggle() + 0x8d bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.Controls.Primitives.ToggleButton.OnClick() + 0xf bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e) + 0x8e bytes
</tt><br>
<tt> System.Windows.dll!System.Windows.Controls.Control.OnMouseLeftButtonUp(System.Windows.Controls.Control ctrl, System.EventArgs e) + 0x31 bytes
</tt><br>
<tt> System.Windows.dll!MS.Internal.JoltHelper.FireEvent(System.IntPtr unmanagedObj, System.IntPtr unmanagedObjArgs, int argsTypeIndex, string eventName) + 0x234 bytes
</tt><br>
<tt> [Appdomain Transition] </tt><br>
</span><br>
I click Step Into and another exception occurs:<br>
<br>
<tt><span style="font-size:10.0pt">System.Reflection.TargetInvocationException occurred</span></tt><span style="font-size:10.0pt;font-family:"Courier New""><br>
<tt> Message=Exception has been thrown by the target of an invocation.</tt><br>
<tt> StackTrace:</tt><br>
<tt> at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)</tt><br>
<tt> at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)</tt><br>
<tt> InnerException: System.TypeInitializationException</tt><br>
<tt> Message=The type initializer for 'Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.DebugeeHost' threw an exception.</tt><br>
<tt> TypeName=Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.DebugeeHost</tt><br>
<tt> InnerException: System.TypeLoadException</tt><br>
<tt> Message=Could not load type 'System.MarshalByRefObject' from assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.</tt><br>
<tt> StackTrace:</tt><br>
<tt> at Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.DebugeeHost..cctor()</tt><br>
<tt> InnerException: </tt></span><br>
<br>
Stepping further shows the System.Windows.Data error I posted below.<br>
<br>
Any ideas/hints? Thank you.<br>
<br>
--<br>
-- Lukáš<br>
<br>
<br>
On 2.9.2010 20:39, Lukas Cenovsky wrote: <o:p></o:p></p>
<p class="MsoNormal"> Following my binding experiments in WPF, I tried to convert the sample into Silverlight and I hit another binding errors there.
<br>
<br>
When I bind anything else than string, I receive an error when the target value is changed and the source should be updated. This happens in all IronPython versions (2.6.1 on .Net 2.0 and 4, 2.7a1).
<br>
<br>
Here is the code I use (the whole source is attached): <br>
<br>
@property <br>
@clrtype.accepts() <br>
@clrtype.returns(System.Nullable[System.Boolean]) <br>
def filtered(self): <br>
return self._filtered <br>
<br>
@filtered.setter <br>
@clrtype.accepts(System.Nullable[System.Boolean]) <br>
@clrtype.returns() <br>
def filtered(self, value): <br>
self._filtered = value <br>
self.OnPropertyChanged('filtered') <br>
<br>
As you can see I tried to use System.Nullable[System.Boolean] instead of bool but it did not help. I also tried to use converter and convert the value to this type (System.Nullable[System.Boolean](value)) but that did not help either. All resulted in the following
exception for bool type. <br>
<br>
System.Windows.Data Error: Cannot save value from target back to source. BindingExpression: Path='filtered' DataItem='Mountains' (HashCode=2058916); target element is 'System.Windows.Controls.CheckBox' (Name=''); target property is 'IsChecked' (type 'System.Nullable`1[System.Boolean]')..
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Security.VerificationException: Operation could destabilize the runtime.
<br>
at Mountains.filtered(Nullable`1 value) <br>
--- End of inner exception stack trace --- <br>
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
<br>
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
<br>
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
<br>
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
<br>
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
<br>
at System.Windows.CLRPropertyListener.set_Value(Object value) <br>
at System.Windows.PropertyAccessPathStep.set_Value(Object value) <br>
at System.Windows.Data.BindingExpression.UpdateValue(). <br>
<br>
The similar exception is raised for float or System.Double. <br>
<br>
I have found an old issue similar to this: <a href="http://ironpython.codeplex.com/workitem/16831?ProjectName=ironpython">
http://ironpython.codeplex.com/workitem/16831?ProjectName=ironpython</a> <br>
<br>
Any workaround would be nice for this bug :-) <br>
<br>
-- <br>
-- Lukáš <br>
<br>
<o:p></o:p></p>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>Users mailing list<o:p></o:p></pre>
<pre><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><o:p></o:p></pre>
<pre><a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><o:p></o:p></pre>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>