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

Project references not resloved in a WinUI 3 C++ project #252

Open
Ruyi-Wonton opened this issue Sep 26, 2022 · 1 comment
Open

Project references not resloved in a WinUI 3 C++ project #252

Ruyi-Wonton opened this issue Sep 26, 2022 · 1 comment

Comments

@Ruyi-Wonton
Copy link

In the project PhotoEditor, why is there exclamation mark in the Reference, prompting "..... references could not be resolved"

The steps to reproduce are as follows

  1. Download this sample https://github.com/microsoft/WindowsAppSDK-Samples.git.
  2. Open WindowsAppSDK-Samples/Samples/PhotoEditor/cpp-winui/PhotoEditor.sln , then the references may be empty.
  3. Rebuild the project, close PhotoEditor.sln, and then reopen it.
  4. Check the references, you will find exclamation mark prompt.
  5. But if you choose the Microsoft.WindowsAppSDK version to 1.0.4, there is no exclamation mark.

My Visual Studio version:Visual Studio Community 2022 17.3.4.

This question comes from Microsoft Q&A (Project references in a WinUI 3 C++ project) and I would like to know how this problem can be solved.

InkedMicrosoftTeams-image (2)_LI

@Scottj1s
Copy link
Member

Scottj1s commented Nov 2, 2022

The given references are being added via Microsoft.WindowsAppSDK.1.1.0\build\native\WindowsAppSDK-Nuget-Native.WinRt.props.

Attempted fixes included:

  • Moving the above references into a targets file instead
  • Adding true to the references

No change was observed with either (or both) of these fixes

As an experiment, moving the references into the vcxproj, with absolute paths, resolved the issue. So this issues is unique to transitive references in referenced packages.

Design time logs attached, created via env vars:
set TRACEDESIGNTIME=true
set _REFERENCE_DEBUG=true

DesignTimeLogs.zip

Note that minimal repro doesn't require a build, just a nuget restore

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

3 participants
@Scottj1s @Ruyi-Wonton and others