<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-2"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
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>System.Security.VerificationException occurred<br>
Message=Operation could destabilize the runtime.<br>
StackTrace:<br>
at Mountains.filtered(Nullable`1 value)<br>
InnerException: </tt><br>
<br>
No source available.This is the Call stack:<br>
<br>
<tt>> Snippets.scripting!Mountains.filtered.set(bool? value) +
0x23 bytes <br>
[Native to Managed Transition] <br>
[Managed to Native Transition] <br>
System.Windows.dll!System.Windows.CLRPropertyListener.Value.set(object
value) + 0x23 bytes <br>
System.Windows.dll!System.Windows.PropertyAccessPathStep.Value.set(object
value) + 0x10 bytes <br>
System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValue()
+ 0x3b2 bytes <br>
System.Windows.dll!System.Windows.Data.BindingExpression.UpdateValueIfNecessary()
+ 0x27 bytes <br>
System.Windows.dll!System.Windows.Data.BindingExpression.TargetPropertyChanged(System.Windows.DependencyObject
sender, System.Windows.DependencyProperty dp) + 0x2b bytes <br>
System.Windows.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyProperty
dp) + 0x17 bytes <br>
System.Windows.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyProperty
dp) + 0x51 bytes <br>
System.Windows.dll!System.Windows.DependencyObject.RaisePropertyChangeNotifications(System.Windows.DependencyProperty
dp, object oldValue, object newValue) + 0x5c bytes <br>
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 <br>
System.Windows.dll!System.Windows.DependencyObject.SetValueInternal(System.Windows.DependencyProperty
dp, object value, bool allowReadOnlySet) + 0x1da bytes <br>
System.Windows.dll!System.Windows.Controls.Primitives.ToggleButton.OnToggle()
+ 0x8d bytes <br>
System.Windows.dll!System.Windows.Controls.Primitives.ToggleButton.OnClick()
+ 0xf bytes <br>
System.Windows.dll!System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs
e) + 0x8e bytes <br>
System.Windows.dll!System.Windows.Controls.Control.OnMouseLeftButtonUp(System.Windows.Controls.Control
ctrl, System.EventArgs e) + 0x31 bytes <br>
System.Windows.dll!MS.Internal.JoltHelper.FireEvent(System.IntPtr
unmanagedObj, System.IntPtr unmanagedObjArgs, int argsTypeIndex,
string eventName) + 0x234 bytes <br>
[Appdomain Transition] <br>
</tt><br>
I click Step Into and another exception occurs:<br>
<br>
<tt>System.Reflection.TargetInvocationException occurred<br>
Message=Exception has been thrown by the target of an
invocation.<br>
StackTrace:<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>
InnerException: System.TypeInitializationException<br>
Message=The type initializer for
'Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.DebugeeHost'
threw an exception.<br>
TypeName=Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.DebugeeHost<br>
InnerException: System.TypeLoadException<br>
Message=Could not load type
'System.MarshalByRefObject' from assembly 'mscorlib,
Version=2.0.5.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e'.<br>
StackTrace:<br>
at
Microsoft.VisualStudio.DebuggerVisualizers.DebugViewerShim.DebugeeHost..cctor()<br>
InnerException: </tt><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:
<blockquote cite="mid:4C7FEF5A.9000404@bakalari.cz" type="cite"> 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 class="moz-txt-link-freetext" 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>
<pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a>
</pre>
</blockquote>
<br>
</body>
</html>