CsWinRT icon indicating copy to clipboard operation
CsWinRT copied to clipboard

Automatically project referenced WinRT components without CsWinRTIncludes

Open Scottj1s opened this issue 3 years ago • 2 comments

Repro sample here: https://github.com/Scottj1s/ReunionCsAppWithCppRC/blob/22a8792d54a15c3ace13e131808e63300635a7f0/App3/App3/App3.csproj#L6

CsWinRTWindowsMetadata should default to TargetPlatformMinVersion. And CsWinRTIncludes should default to enabling anything which is not expressly in CsWinRTExcludes (Microsoft, Windows).

Scottj1s avatar Mar 26 '21 17:03 Scottj1s

#657 closes CsWinRTWindowsMetadata issue

angelazhangmsft avatar Mar 29 '21 23:03 angelazhangmsft

I think this is very much needed. With C++/WinRT being a first class citizen in the Microsoft techstack, we need smooth tech interop as is expected and available on all other Microsoft languages/technologies. It's ok to require adding a NuGet to allow interop from C++/WinRT to .NET Core. But additionally requiring manual editing of project files does not make sense.

If no inputs are explicitly configured, CsWinRT should generate and compile projection headers for all referenced winmd projects. It should be as easy as that. Add CsWinRT nuget, add your C++\WinRT project references, and things should just work.

One more thing to make the above vision work would be automatically moving referenced binaries into the expected place (not directly into the project output folder, but into runtimes\win10-\native). This would allow us to get rid of the intermediate NuGet packages and directly work with project references. Having to create NuGets inside the develop+debug loop is a productivity nightmare. But I will open a separate issue for that.

lukasf avatar Oct 24 '22 20:10 lukasf