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

Can't add project reference in 'Cross-Platform Library' #3909

Closed
2 of 23 tasks
stefanolson opened this issue Aug 29, 2020 · 4 comments
Closed
2 of 23 tasks

Can't add project reference in 'Cross-Platform Library' #3909

stefanolson opened this issue Aug 29, 2020 · 4 comments
Labels
area/solution-templates Categorizes an issue or PR as relevant to the solution template area/vswin Categorizes an issue or PR as relevant to Visual Studio for Windows kind/bug Something isn't working project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools

Comments

@stefanolson
Copy link

stefanolson commented Aug 29, 2020

Current behavior

I am unable to add a reference to another project within a Cross-Platform Library

Expected behavior

Should be able to create a reference to another project.

How to reproduce it (as minimally and precisely as possible)

Create a new uno project. Within the project create a new 'Cross-Platform Library'. Right click on the new project, choose add project reference. Get the message "Missing value for TargetPlatformWinMDLocation property".

(Not sure how to include pre-built project in this report)

Workaround

Temporarily move the uap10.0.xxx target framework to be at least second in the TargetFrameworks list.

Environment

Nuget Package:

  • Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: 16.7.2 )
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper (version: 2020.2 )

Anything else we need to know?

@stefanolson stefanolson added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Aug 29, 2020
@francoistanguay francoistanguay added this to the Urgent milestone Aug 29, 2020
@francoistanguay francoistanguay removed the triage/untriaged Indicates an issue requires triaging or verification label Aug 29, 2020
@jeromelaban jeromelaban added the area/solution-templates Categorizes an issue or PR as relevant to the solution template label Aug 31, 2020
@jeromelaban
Copy link
Member

jeromelaban commented Sep 1, 2020

Unfortunately, there's no good solution for this issue, as it causes a conflict between two VS features (add reference, and XAML intellisense).

This is caused by the fact that uap10.0.16299 is the first target framework of the list. Changing this make adding references work, but then breaks XAML intellisense. This is the result of UWP not supporting sdk-style projects, and the use of MSBuild.Sdk.Extras to enable cross targeting.

Currently, the only workaround is to move netstandard2.0 as the first target framework, then add the reference.

@stefanolson
Copy link
Author

@jeromelaban Thanks. I've managed to get the reference in place now. But when I try and build the first library, it failed due to not finding uap10.0.16299. Now I think that just because it's got the wrong version as I don't have that SDK installed (got 18362), but I'm pretty sure that reference was created by Uno? Is it possible for Uno to sense what SDKs are installed and use the correct version? Having said that, that's more minor than the above problem. Hopefully reading this will help anyone else who has the same issue.

Thanks!

@jeromelaban
Copy link
Member

Thanks for the update. It would probably be possible to determine which versions are available, though that logic may not be easy to determine.

In all cases, the support of .NET 5 for UWP/WinUI will change all this and it will become lots easier to work with.

@jeromelaban jeromelaban removed this from the HighPriority milestone Sep 1, 2020
@agneszitte agneszitte added the project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools label Sep 21, 2020
@jeromelaban jeromelaban added the difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. label Feb 15, 2021
@MartinZikmund MartinZikmund added area/vswin Categorizes an issue or PR as relevant to Visual Studio for Windows and removed difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jun 1, 2021
@jeromelaban
Copy link
Member

While this issue is still valid for UWP, it's now fixed with WinAppSDK. Closing as evolution made its work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/solution-templates Categorizes an issue or PR as relevant to the solution template area/vswin Categorizes an issue or PR as relevant to Visual Studio for Windows kind/bug Something isn't working project/core-tools 🛠️ Categorizes an issue or PR as relevant to core and tools
Projects
None yet
Development

No branches or pull requests

5 participants