FileNotFoundException in Silverlight for WP7

The file or assembly name is 'System.Windows.debug.resources, Version = 2.0.5.0, Culture = en-US, PublicKeyToken = 7cec85d7bea7798e' or one of its dependencies was not found.

I am almost sure that this is due to the fact that some file is not installed correctly, and I see how this exception occurs in different cases. It could be a file with exception names in it.

Does anyone know if I can reinstall it or something like that?

This happens in a place where there is no disassembly.

Callstack Location

mscorlib.dll!System.ThrowHelper.throwVersion37CompatException(System.ExceptionType newEType = FileNotFoundException, string newString = "File or assembly name 'System.Windows.debug.resources, Version=2.0.5.0, Culture=en-US, PublicKeyToken=7cec85d7bea7798e', or one of its dependencies, was not found.", System.ExceptionType oldEType = IOException, string oldString = "File or assembly name 'System.Windows.debug.resources, Version=2.0.5.0, Culture=en-US, PublicKeyToken=7cec85d7bea7798e', or one of its dependencies, was not found.") + 0x19 bytes 

Complete Exception Details

 System.IO.FileNotFoundException occurred Message=File or assembly name 'System.Windows.debug.resources, Version=2.0.5.0, Culture=en-US, PublicKeyToken=7cec85d7bea7798e', or one of its dependencies, was not found. StackTrace: at System.ThrowHelper.throwVersion37CompatException(ExceptionType newEType, String newString, ExceptionType oldEType, String oldString) at System.Reflection.Assembly.Load(String assemblyString) at System.Windows.Resx..ctor() at System.Windows.Resx.GetLoader() at System.Windows.Resx.GetStringHelper(String name) at System.Windows.Resx.GetString(String name) at System.Windows.PropertyAccessPathStep.ConnectToPropertyInSource(Boolean isSourceCollectionViewCurrentItem) at System.Windows.PropertyAccessPathStep.ConnectToProperty() at System.Windows.PropertyAccessPathStep.ReConnect(Object newSource) at System.Windows.PropertyPathListener.ReConnect(Object source) at System.Windows.Data.BindingExpression.SourceAcquired() at System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e) at System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e) at System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e) at System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e) at System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e) at System.Windows.FrameworkElement.OnTreeParentUpdated(DependencyObject newParent, Boolean bIsNewParentAlive) at System.Windows.DependencyObject.UpdateTreeParent(IManagedPeer oldParent, IManagedPeer newParent, Boolean bIsNewParentAlive, Boolean keepReferenceToParent) at MS.Internal.FrameworkCallbacks.ManagedPeerTreeUpdate(IntPtr oldParentElement, IntPtr parentElement, IntPtr childElement, Byte bIsParentAlive, Byte bKeepReferenceToParent, Byte bCanCreateParent) at MS.Internal.XcpImports.Measure_WithDesiredSizeNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) at MS.Internal.XcpImports.UIElement_Measure_WithDesiredSize(UIElement element, Size availableSize) at System.Windows.UIElement.Measure_WithDesiredSize(Size availableSize) at System.Windows.Controls.VirtualizingStackPanel.MeasureChild(UIElement child, Size layoutSlotSize) at System.Windows.Controls.VirtualizingStackPanel.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight) at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight) at MS.Internal.XcpImports.MeasureNative(IntPtr element, Single inWidth, Single inHeight) at MS.Internal.XcpImports.UIElement_Measure(UIElement element, Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight) at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight) at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight) at MS.Internal.XcpImports.MeasureOverrideNative(IntPtr element, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight) at MS.Internal.XcpImports.FrameworkElement_MeasureOverride(FrameworkElement element, Size availableSize) at System.Windows.FrameworkElement.MeasureOverride(Size availableSize) at Microsoft.Phone.Controls.PhoneApplicationFrame.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Double inWidth, Double inHeight, Double& outWidth, Double& outHeight) 
+8
c # exception visual-studio windows-phone-7 silverlight
source share
4 answers

Here is the MSDN link. It looks like they haven't fixed it in WP 7.1 (Mango) yet. I am experiencing the same problem.

http://social.msdn.microsoft.com/forums/en-us/windowsphone7series/thread/2B040008-A240-470D-91AF-E998984FFF12

+4
source share

Are you 100% sure that you get this exception in the usual, "syllabic" style? I stumble upon this very often, but only if I configured the System.IO.FileNotFound or System.IO.IsolatedStorage excepion interceptors in the Debug-> Exceptions option in VisualStudio.

It is worth noting that on WP7, Exception interceptors catch every generated excime that corresponds to the selected type. I mean, everyone, even if it is handled correctly. That's why I see them, I very often use these interceptors to debug my own code. Maybe you also activated them and just forgot about them?

+2
source share

There is an easy workaround: simply create your own CheckBox control by inheriting the Windows Phone Silverlight CheckBox and overriding the ToString () method as follows:

 public class MyCheckBox:CheckBox { public override string ToString() { return string.Empty; } } 

see here: Framework Exceptions on Windows Phone

+2
source share

This happens to me whenever Visual Studio 2010 tries to format an error message while converting XAML data values ​​(i.e. handle the IValueConverter specified using the data binding expression).

The workaround I found is just a break in the debugger, double-click one of the stack trace entries about 2 or three levels down, then look in the Locals window to see the error message that it is trying to format, and the parameters binding expression.

You should be able to determine what was wrong there, for example. it can be a typo in the part of the binding expression path (the property name is incorrect / the source does not exist) or an unsupported conversion (the value converter is not specified and the default conversion is not supported).

The MSDN link provided by the user "invalidusername" here no longer works (it seems to have been removed from the new Metro-style Dev Center site), so I couldn’t check any other known workaround or fix it. This must be registered on MS Connect really. However, the Windows Phone 8 SDK will appear soon (currently rumored September 12th), so I think we should wait and see how this happens with VS 2012 and the new SDK (it is assumed that it still supports OS 7.1 phones! )

0
source share

All Articles