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

WinUI3 Preview 3 package misses globbing pattern for PRIResource #3648

Closed
huoyaoyuan opened this issue Nov 19, 2020 · 19 comments
Closed

WinUI3 Preview 3 package misses globbing pattern for PRIResource #3648

huoyaoyuan opened this issue Nov 19, 2020 · 19 comments
Assignees
Labels
area-Resources needs-assignee-attention Assignee needs to follow-up or investigate this issue product-winui3 WinUI 3 issues team-Markup Issue for the Markup team

Comments

@huoyaoyuan
Copy link

huoyaoyuan commented Nov 19, 2020

Issues I've met when upgrading a functioning project from preview2 to preview3:

Can't find ResourceMap:

#3620 (comment)
/cc @roxk

Cause:

The preview 3 nuget package doesn't include a glob pattern for PRIResource, while preview 2.

Workaround:

Add this to your project file:

  <ItemGroup>
    <PRIResource Include="Strings\**\*.resw" />
    <!-- Strings may be changed to other folder you use, or just **\*.resw -->
  </ItemGroup>
### XamlParseException
onecoreuap\base\appmodel\statemanager\winrt\lib\windows.storage.applicationdatafactory.server.cpp(235)\Windows.Storage.ApplicationData.dll!00007FFD72EF83F3: (caller: 00007FFD72F087B3) ReturnHr(1) tid(695c) 8000000B 该操作尝试访问的数据超出了有效范围

Wrapped by XamlParseException.

Currently no idea. Investigating.

Edit: this one should be unrelated.

@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Nov 19, 2020
@huoyaoyuan huoyaoyuan changed the title String resource related issue in WinUI3 Preview 3 WinUI3 Preview 3 package misses globbing pattern for PRIResource Nov 19, 2020
@roxk
Copy link

roxk commented Nov 19, 2020

@huoyaoyuan Thanks for the heads up. In my case, I found that the .resw files are already included in the project file so my crash seems to be different than yours. Specifically, XXX.Label and XXX.Text works fine, but XXX.ToolTipService.ToolTip would crash. Workaround is just removing these tool tip resources😅 I will file a new issue once I have a minimal repro.

@stevenbrix
Copy link
Contributor

Interesting, I'm not aware of anything that would have changed here. @rohanp-msft, do you know if this is due to using the new PRI gen tooling?

@stevenbrix stevenbrix added team-Markup Issue for the Markup team and removed team-Framework labels Dec 7, 2020
@rohanp-msft
Copy link

Interesting, I'm not aware of anything that would have changed here. @rohanp-msft, do you know if this is due to using the new PRI gen tooling?

looking now

@rohanp-msft
Copy link

@huoyaoyuan Hi Huo, what kind of winui3 project is this? Examples are below:
image

@huoyaoyuan
Copy link
Author

@rohanp-msft C# desktop, packaged. The project was manually updated from preview 2, which didn't request adding entry.

@rohanp-msft
Copy link

@stevenbrix For C# desktop, packaged apps, no, the new PRI gen tooling didn't introduce the need to do this. (The reason I asked about the type of project is that for class lib projects, I noticed that, both with winui 2 and 3, string resources don't make it into the class lib's PRI. That's what I'm working on figuring out now.)
CC @huoyaoyuan

@huoyaoyuan
Copy link
Author

@rohanp-msft I mistyped it. I was using C# classlib.

@rohanp-msft
Copy link

@huoyaoyuan Huo, that's something I've seen before. I tried to repro it today but couldn't. Here's the issue where I recorded my repro attempt: microsoft/WindowsAppSDK#246
Can you repro it with a new WinUI class lib project? If yes, can you share your setup like what I shared in the link, please?

@JeanRoca JeanRoca added needs-author-feedback Asked author to supply more information. and removed needs-triage Issue needs to be triaged by the area owners labels Dec 9, 2020
@huoyaoyuan
Copy link
Author

@rohanp-msft Adding a resw using Visual Studio dialog adds <PRIResource Include="Resources.resw" /> in the project file. If it's commented out, Visual Studio shows it as None.

@ghost ghost added needs-triage Issue needs to be triaged by the area owners and removed needs-author-feedback Asked author to supply more information. labels Dec 10, 2020
@rohanp-msft
Copy link

rohanp-msft commented Dec 10, 2020

@huoyaoyuan Was that line present in the project file before you upgraded to WinUI 3.0 from WinUI 2.0? Did it go away after the upgrade?

@huoyaoyuan
Copy link
Author

@rohanp-msft I upgraded from WinUI 3 Preview 2. Preview 2 didn't require the line. I did the upgrade manually.

@rohanp-msft
Copy link

OK, thanks for the info, @huoyaoyuan. I'll try to repro that (creating a new WinUI 3 Preview 3 project works for me, but if I try upgrading to it, perhaps it won't).

@rohanp-msft
Copy link

@huoyaoyuan Would you please share the pre-migration project file? Or point me to it?

@sjb-sjb
Copy link

sjb-sjb commented Jan 26, 2021

I had a similar problem. In addition to adding the globbing pattern in a PRIResource tag, I had to go to each of the various .resw files in my project and verify that the build action was set to PRIResource. Even though all of the .resw files were added to the project in the same manner (by copying them into the project directory using FIle Explorer) some of them had the PRIResource build action while others did not.

Comment: at first, I accidentally (and incorrectlyi) used a path such as

<PRIResource Include="\**\Library\**\*.resw" />

This caused massive problems including for example extremely long time to just Clean the solution.

@JeanRoca JeanRoca added the needs-author-feedback Asked author to supply more information. label Feb 3, 2021
@JeanRoca
Copy link

JeanRoca commented Feb 3, 2021

@huoyaoyuan this should be fixed by RTM.

@JeanRoca JeanRoca removed the needs-triage Issue needs to be triaged by the area owners label Feb 3, 2021
@huoyaoyuan
Copy link
Author

Preview 4 behaves the same with Preview 3. Waiting for it.

@ghost ghost added needs-assignee-attention Assignee needs to follow-up or investigate this issue needs-triage Issue needs to be triaged by the area owners and removed needs-author-feedback Asked author to supply more information. labels Feb 12, 2021
@JeanRoca JeanRoca removed the needs-triage Issue needs to be triaged by the area owners label Mar 3, 2021
@huoyaoyuan
Copy link
Author

@JeanRoca It's still missing in Reunion 0.5.

@rohanp-msft
Copy link

@JeanRoca It's still missing in Reunion 0.5.

Hi @huoyaoyuan,
As you pointed out, this falls under microsoft/WindowsAppSDK#613.
You beat me to suggesting duping this to that bug.
Sorry about the delay here. The issue was not fully understood until recently.
The fix should be available in v0.8 preview of Project Reunion which starts shipping this month.
Please follow microsoft/WindowsAppSDK#613 to track completion.
Feel free to dupe this issue to microsoft/WindowsAppSDK#613.

@huoyaoyuan
Copy link
Author

Solved in 0.8 stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Resources needs-assignee-attention Assignee needs to follow-up or investigate this issue product-winui3 WinUI 3 issues team-Markup Issue for the Markup team
Projects
None yet
Development

No branches or pull requests

7 participants