Question

This WPF app targets .NET 3.5 and is built with the 4.0 tools from Visual Studio 2010 (csc.exe version is 4.0.30319.1).

I'm not sure what to make of this exception I'm seeing. The same exe has been working for months on all machines, but just today a customer ran into this. I'm unable to repro it locally, all I have to go on is the stack trace from our log files below.

I made a quick sample application with Visual Studio 2010 that just shows a button in a Window, the button Content string being pulled from a resource dictionary. This worked on the customers machine, so it appears the .NET installation isn't completely hosed there...

Any ideas on what to investigate or look into next? Maybe some state of the customers .NET install??

EDIT: The customer performed an uninstall and reinstall of .NET 3.5 and that fixed the issue. I guess there was some weird state in their installation that was causing this issue.

System.Windows.Markup.XamlParseException: 'MainWindowViewResources.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Error at object 'System.Windows.ResourceDictionary' in markup file 'symformconfig;component/view/mainwindowview.xaml'. ---> System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at System.IO.Packaging.PackagePart.CleanUpRequestedStreamsList() at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access) at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream() at System.IO.Packaging.PackWebResponse.GetResponseStream() at System.IO.Packaging.PackWebResponse.get_ContentType() at MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response) at MS.Internal.WpfWebRequestHelper.GetResponseStream(WebRequest request, ContentType& contentType) at System.Windows.ResourceDictionary.set_Source(Uri value) --- End of inner exception stack trace --- at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType) at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException) at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId) at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord) at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at System.Windows.Markup.TreeBuilder.Parse() at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) at Symform.Node.Configuration.MainWindowView.InitializeComponent() at Symform.Node.Configuration.MainWindowView..ctor() at Symform.Node.Configuration.App.OnStartup(StartupEventArgs e) at System.Windows.Application.<.ctor>b__0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

Was it helpful?

Solution 2

The customer performed an uninstall and reinstall of .NET 3.5 and that fixed the issue. I guess there was some weird state in their installation that was causing this issue.

OTHER TIPS

Make sure that the BuildAction of MainWindowViewResources.xaml is set to Page and not Resource. You can find that setting in the Properties panel.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top