Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anchor resource errors in ProgressDialog.resx Resource Explorer #12686

Open
John-Qiao opened this issue Dec 27, 2024 · 6 comments
Open

Anchor resource errors in ProgressDialog.resx Resource Explorer #12686

John-Qiao opened this issue Dec 27, 2024 · 6 comments
Assignees

Comments

@John-Qiao
Copy link
Member

John-Qiao commented Dec 27, 2024

.NET version

Latest winforms repo main branch.

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

No response

Issue description

Cannot load resource value for ButtonCloseDialog.Anchor, Labellnfo.Anchor and ProgressBarWork.Anchor in ProgressDialog.resx's Resource Explorer manager.

Image

Steps to reproduce

  1. Clone https://github.com/dotnet/winforms main branch and launch it in VS
  2. Double click on ProgressDialog.resx to open its Resource Explorer
  3. Check the values for ButtonCloseDialog.Anchor, Labellnfo.Anchor and ProgressBarWork.Anchor

More info:

  1. It's a feedback ticket from https://developercommunity.visualstudio.com/t/Issues-with-new-Resource-Manager/10819644.
  2. There are no such anchor values in old resource explorer.
    Image
@John-Qiao John-Qiao added the untriaged The team needs to look at this issue in the next triage label Dec 27, 2024
@Zheng-Li01
Copy link
Member

The issue also can reproduce with the Language, Dock, RightToLeft etc. properties as below screenshot.

Image

Form1.resx file info:
Form1.txt

@LeafShi1 LeafShi1 removed the untriaged The team needs to look at this issue in the next triage label Dec 30, 2024
@LeafShi1
Copy link
Member

LeafShi1 commented Dec 31, 2024

In the Resource Explorer Preview page, all resource items are displayed

We can fix this by adding the version and PublicKeyToken to the type properties.

<data name="ButtonCloseDialog.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
    <value>Top, Right</value>
</data>

@merriemcgaw @Tanya-Solyanik But this is just a preview feature. Do we need to make changes in our code?

@paul1956
Copy link
Contributor

@merriemcgaw @Tanya-Solyanik @LeafShi1 I opened all the .Resx files and there are several similar issues
Image

and resource names without values as shown below, the first one might be an empty string and be OK but then why does it exist as a resource.
Image

@merriemcgaw
Copy link
Member

This is helpful, thanks @paul1956 - we'll pick it up in the new year for sure!

@LeafShi1
Copy link
Member

LeafShi1 commented Jan 2, 2025

For the resources without values, we can add attribute xml:space="preserve" to resolve this issue

<data name="listViewCannedMasks.Columns2" xml:space="preserve">
    </value />
</data>

The resource byteViewer is using in BinaryEditor.BinaryUI, store its properties in the resource file. When we need to modify these properties, we only need to update the resource file without modifying the code itself.

Image

@paul1956
Copy link
Contributor

paul1956 commented Jan 2, 2025

@LeafShi1 when you say "we", is there (or should there be) someone assigned to make these changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants