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

resource/image file added from VS UI will not be built into PRI file for WPF project #1674

Closed
huichen123 opened this issue Oct 28, 2021 · 5 comments · Fixed by #2367
Closed
Assignees
Milestone

Comments

@huichen123
Copy link
Contributor

Describe the bug
In a WPF project, adding resource image file from VS UI, the project is automatically modified to exclude those files. Thus they are not built into final PRI file.

Steps to reproduce the bug
Steps to reproduce the behavior:

  1. Create a new WPF project
  2. Reference to WindowsAppSDK 1.0-preview3
  3. add a new resources.resw file or an existing image file to the project. The csproj file automatically adds something like:
  <ItemGroup>
    <Content Remove="SplashScreen.scale-200.png" />
  </ItemGroup>

  <ItemGroup>
    <PRIResource Remove="Resources.resw" />
  </ItemGroup>
  1. build
  2. The image and resource strings are not built into PRI file

Expected behavior
The image and resource strings are built into PRI file

Screenshots

Version Info

NuGet package version:
[Microsoft.WindowsAppSDK 1.0.0-preview3]

Windows version Saw the problem?
Insider Build (xxxxx)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)

Additional context
This seems to be a regression caused by #1389. Workaround is to manually remove those ItemGroup added automatically.

@rohanp-msft
Copy link
Contributor

Just a note: this faulty behavior was seen with WinForm/Console apps too. See dupe #1786.

@ghost
Copy link

ghost commented Feb 19, 2022

The image and resource strings are not built into PRI file

so is WinUI 3 (both Packaged and Unpackaged are affected --> xbfs files are not built into pri file).
see #1248 (comment)

@rohanp-msft
Copy link
Contributor

This issue cannot be properly addressed in the Windows App SDK. It requires .NET SDK support. Will be filing feature request.

@rohanp-msft
Copy link
Contributor

The image and resource strings are not built into PRI file

so is WinUI 3 (both Packaged and Unpackaged are affected --> xbfs files are not built into pri file). see #1248 (comment)

Hi @ghost, the two issues are unrelated. In fact, with the referenced issue, the XBFs are embedded in the PRI, it's just that they're also loosely deployed (that's for WAPPROJ based apps; single-project MSIX Packaging doesn't have that issue).

@rohanp-msft
Copy link
Contributor

rohanp-msft commented May 4, 2022

This issue is fixed by the merged PR above if .NET SDK v6.0.300 or higher is used by the app. That fix will be available in 1.1 Stable.

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