Uh oh!
There was an error while loading. Please reload this page.
Override GetResolvedWinMD to make sure all native build targets are aware of the C++/WinRT produced WinMD. - #432
Conversation
…nMD. VS uses this to resolve project output.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Scott Jones (Scottj1s)
commented
Nov 26, 2019
I'm a bit nervous about overriding all these internal CX targets. That has the potential to make our nuget brittle (or at least specific to VS versions). What's wrong with the alternative of just setting GenerateWindowsMetadata back to true for the RC project template? You describe that as a "workaround" - how so? |
Johan Laanstra (jlaanstra)
commented
Nov 26, 2019
These are standard OutputGroup targets, meant to be overriden. |
Johan Laanstra (jlaanstra)
commented
Nov 26, 2019
Scott Jones (@Scottj1s) the other option is for us to override the GetResolvedWinMD target, to make it aware of the C++/WInRT WinMD. Thoughts? |
Kenny Kerr (kennykerr)
left a comment
There was a problem hiding this comment.
Have we confirmed that:
- this allows both C#->C++ project references and
- activation works in that scenario automatically and
- a basic Razzle project builds successfully?
Kenny Kerr (@kennykerr) Added todo's, so you can see what I have verified. |
| Condition="'$(CppWinRTGenerateWindowsMetadata)' == 'true'" | ||
| <!-- This target overrides the GetResolvedWinMD target used to resolve the WinMD for native projects | ||
| so it is aware of the C++/WinRT generated WinMD. | ||
| Since not every project that consumesd C++/WinRT uses it to generate a WinMD, |
Scott Jones (Scottj1s)
commented
Nov 27, 2019
ok, let's give it a spin with vsix/razzle |
Uh oh!
There was an error while loading. Please reload this page.
Since the project templates no longer set the flags that enable the MSBuild logic to tell MSBuild about the CX generated WinMD, we have to override the GetResolvedWinMD target to ensure that VS and MSBuild pick up the correct WinMD project output. Unfortunately the target is not very extensible, so we have to override it.
VS uses this to resolve project output and without this change the PrimaryWinMDFullPath itemgroup is empty resulting in VS being unable to add project references to C++/WinRT projects.
TODO:
Fixes#425