Skip to content

Conversation

@ryalanms
Copy link
Member

@ryalanms ryalanms commented May 6, 2021

Description

System.Windows.Documents.Serialization.SerializerProvider creation always fails while creating System.Uri.

SerializerProvider sp = new SerializerProvider();

at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at System.Windows.Xps.Serialization.XpsSerializerFactory.get_ManufacturerWebsite()
at System.Windows.Documents.Serialization.SerializerDescriptor.CreateFromFactoryInstance(ISerializerFactory factoryInstance)
at System.Windows.Documents.Serialization.SerializerProvider..ctor()
at TestSerializerProvider.MainWindow..ctor() in D:\PluginSerializer\TestSerializerProvider\MainWindow.xaml.cs:line 30

The issue is that resource lookups for the ReachFramework were not actually resolving the string, and instead were returning the key. When the key Xps_ManufacturersWebsite was passed in to the URI constructor, URI creation failed. Fixing the resource lookup path fixed SerializerProvider. Fixes #4481.

This bug is blocking testing of the fix for another bug that is preventing WPF from taking the latest WinForms update: #4479.

Regression

No. This is a longstanding bug from 3.0.

Testing

Repro'd the failure, fixed the resource string lookup, and verified SerializerProvider is working.

…ing the key value. This caused Uri creation to fail on Xps_ManufacturerWebsite. Update the resource lookups to resolve the resource string from the key.
@ryalanms ryalanms requested a review from a team as a code owner May 6, 2021 01:20
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label May 6, 2021
@ghost ghost requested review from SamBent and fabiant3 May 6, 2021 01:20
Copy link
Contributor

@SamBent SamBent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trust you've checked all the other SR.cs files for the same problem?

@ryalanms
Copy link
Member Author

ryalanms commented May 6, 2021

I trust you've checked all the other SR.cs files for the same problem?

Thanks, Sam. Yes, the other eleven SR.cs files are correct. ReachFramework is the only component that was not calling GetResourceString before Format.

@ryalanms ryalanms merged commit 647001a into main May 6, 2021
@RussKie RussKie deleted the fix.reach.resources branch November 26, 2021 01:20
@ghost ghost locked as resolved and limited conversation to collaborators Apr 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.Windows.Documents.Serialization.SerializerProvider default constructor fails creating System.Uri

3 participants