2
votes

I´m new at this job and when i opened a project i get this error and i´m not able to figure out what´s going on. Any help?

SO: WinXP Sp3, Visual Studio 2010 Express

Thanks in advance.

Exception not controlled. Details: System.Reflection.TargetInvocationException Se produjo una excepción en el destino de la invocación. en System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) en System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) en System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) en System.Delegate.DynamicInvokeImpl(Object[] args) en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

System.NullReferenceException Referencia a objeto no establecida como instancia de un objeto. en ControlPesajeLavanderia.ItemParte.NuevoItemParte_IsVisibleChanged(Object sender, DependencyPropertyChangedEventArgs e) en C:\Documents and Settings\golaizola\Mis documentos\Visual Studio 2010\Projects\ControlPesajeLavanderia\ControlPesajeLavanderia\usercontrols\ItemParte.xaml.vb:línea 186 en System.Windows.UIElement.RaiseDependencyPropertyChanged(EventPrivateKey key, DependencyPropertyChangedEventArgs args) en System.Windows.UIElement.OnIsVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) en System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) en System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) en System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) en System.Windows.UIElement.UpdateIsVisibleCache() en System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(Visual v, DependencyProperty property) en System.Windows.UIElement.OnIsVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) en System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) en System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) en System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) en System.Windows.UIElement.UpdateIsVisibleCache() en System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(Visual v, DependencyProperty property) en System.Windows.UIElement.OnIsVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) en System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) en System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) en System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) en System.Windows.UIElement.UpdateIsVisibleCache() en System.Windows.UIElement.InvalidateForceInheritPropertyOnChildren(Visual v, DependencyProperty property) en System.Windows.UIElement.OnIsVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) en System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) en System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) en System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) en System.Windows.UIElement.UpdateIsVisibleCache() en System.Windows.UIElement.SynchronizeForceInheritProperties(UIElement uiElement, ContentElement contentElement, UIElement3D uiElement3D, DependencyObject parent) en System.Windows.UIElement.OnVisualParentChanged(DependencyObject oldParent) en System.Windows.FrameworkElement.OnVisualParentChanged(DependencyObject oldParent) en System.Windows.Media.Visual.FireOnVisualParentChanged(DependencyObject oldParent) en System.Windows.Media.Visual.AddVisualChild(Visual child) en System.Windows.FrameworkElement.set_TemplateChild(UIElement value) en System.Windows.Controls.ContentPresenter.UseContentTemplate.BuildVisualTree(FrameworkElement container) en System.Windows.StyleHelper.ApplyTemplateContent(UncommonField1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate) en System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField1 templateDataField, FrameworkElement container) en System.Windows.FrameworkElement.ApplyTemplate() en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Controls.Border.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Controls.Control.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Controls.Border.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en MS.Internal.Designer.ZoomableViewPresenter.DesignerBackground.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Controls.Decorator.MeasureOverride(Size constraint) en Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) en System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) en System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) en System.Windows.Controls.Grid.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Controls.Grid.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) en System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Controls.Control.MeasureOverride(Size constraint) en System.Windows.FrameworkElement.MeasureCore(Size availableSize) en System.Windows.UIElement.Measure(Size availableSize) en System.Windows.Interop.HwndSource.SetLayoutSize() en System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value) en System.Windows.Interop.HwndSource.set_RootVisual(Visual value) en MS.Internal.DeferredHwndSource.ProcessQueue(Object sender, EventArgs e)

UPDATE:

I created a new form and copy all xaml until i get the error. The error happens when i included my own usercontrol in this line:

and the error says: "Object reference not set to an instance of an object."

And I don´t know why...

2
Could you translate for us in English what the message says?Liviu Mandras
I assume it's 'Object reference not set to an instance of an object'.mcm69

2 Answers

2
votes

If you get the error (yes, it looks like object reference not set) at design view only, then I would suggest creating another blank form and copying the text piece by piece until you copy the text that gives you the error. Otherwise you will not know where to start to diagnose this error.

This line in this file might have something to do with the error:

C:\Documents and Settings\golaizola\Mis documentos\Visual Studio 2010\Projects\ControlPesajeLavanderia\ControlPesajeLavanderia\usercontrols\ItemParte.xaml.vb

Line 186

0
votes

DEAR SWEET EXCEPTION MESSAGE!!! You're throwing an exception in a constructor somewhere, which is very hard to tell where from an exception message; I am making this judgement based on the TargetInvocationException which always seems to indicate this.

If I'm right, somewhere in a constructor you're making the assumption that a variable is not null.

Go through EVERY class in your solution and examine the constructors. Perform null checks on everything you touch. If no obvious issue exists, start removing logic from any constructor used in a type that is instantiated within the designer. You'll eventually find it.