Skip to content

Add default WinMD references to the desktop templates. - #781

Merged
Johan Laanstra (jlaanstra) merged 3 commits into
masterfrom
user/jlaans/780
Nov 2, 2020
Merged

Add default WinMD references to the desktop templates.#781
Johan Laanstra (jlaanstra) merged 3 commits into
masterfrom
user/jlaans/780

Conversation

@jlaanstra

@jlaanstra Johan Laanstra (jlaanstra) commented Oct 27, 2020

Copy link
Copy Markdown
Contributor

For Universal Windows templates the xaml build targets and C++ build targets add the platform WinMDs to the reference list. However this doesn't happen for desktop templates , because the TargetPlatformIdentifier is not set to UAP.

We have two options:

  • Set TargetPlatform to UAP
  • Explicitly add the references.

Since these are desktop templates, option 2 seems preferable.

A possibly even better solution would be the WinRT targets to add the references. However we would have to fight the default C++ build targets to have them stop automatically adding the references and that would be quite a bit of work and possibly break xaml.

Fixes #780

@kennykerr

Copy link
Copy Markdown
Collaborator

Will this also fix #774 (comment)? cc Dustin L. Howett (@DHowett)

@DHowett

Copy link
Copy Markdown
Member

We've been told by the VC project system folks in no uncertain terms that wildcards are explicitly disallowed in vcxprojs (outside of a Target that generates them!) and they'll go out of their way to break them. This solution may conflict with that.

@jlaanstra

Johan Laanstra (jlaanstra) commented Oct 27, 2020

Copy link
Copy Markdown
Contributor Author

I am personally not a fan of this solution either. Problem is that there is no good way to add them one by one explicitly as the folder location differs per version and the C++ targets don't add any WinMDs for non-UAP projects.

If C++/WinRT targets add a set of default WinMDs, they will conflict what the C++ targets add for UAP.
If C++/WinRT targets don't add a set of default WinMDs, desktop projects have no references.

@kennykerr

Copy link
Copy Markdown
Collaborator

The project system isn't exactly abounding in support for C++ developers. Much of this is making the best of some bad choices.

@jlaanstra

Copy link
Copy Markdown
Contributor Author

Let's hold off on merging this for now. I'm gonna add a target that adds the platform winmds and then have desktop templates opt-in. That's probably a better solution.

@jlaanstra

Copy link
Copy Markdown
Contributor Author

isn't exactly abounding in support for C++ developers. Much of this is making the best of some bad choices.

I'll try to find a good (or at least much better) choice here.

@jlaanstra

Copy link
Copy Markdown
Contributor Author

We've been told by the VC project system folks in no uncertain terms that wildcards are explicitly disallowed in vcxprojs (outside of a Target that generates them!) and they'll go out of their way to break them. This solution may conflict with that.

Thanks for calling this out Dustin L. Howett (@DHowett)

@jlaanstra

Copy link
Copy Markdown
Contributor Author

Updated with a target that mimics what the xaml targets do, including keeping the support for the existing overrides. I don't think we have to document this as we already have CppWinRTOverrideSDKReferences.

@kennykerr Kenny Kerr (kennykerr) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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

Successfully merging this pull request may close these issues.

No generated code for console app

3 participants