Open techyrajeev opened 1 year ago
Right, you can't directly reference the winmd. I think you need to project that type (PreviewTeamDeviceCredentials
) to use it, like this
I am able remove errors with below changes, is this the correct way? lib is folder where I have stored winmd file within project root.
<PropertyGroup>
<CsWinRTIncludes>Windows.UI.Core.Preview.Communications</CsWinRTIncludes>
</PropertyGroup>
<ItemGroup>
<!--Explicitly reference WinAppSDK winmds from TFM uap10.0-->
<CsWinRTInputs Include="lib\*.winmd" />
</ItemGroup>
Please review @j0shuams. Thanks
Did you install C#/WinRT?
yes @dongle-the-gadget, I did
Debug is running fine but during release build getting this error @j0shuams, @dongle-the-gadget -
The type or namespace name 'Communications' does not exist in the namespace 'Windows.UI.Core.Preview' (are you missing an assembly reference?)
@techyrajeev I'm surprised this is not working on release. Check your VS build configuration and for each permutation (Debug|x64, Release|x64, Debug|x86, etc...) make sure things are matching up.
If that's not it, feel free to attach a binlog.
@j0shuams do I need to create a separate project with winmd file and generate its projection and reference the nuget in my current project? Currently I directly added
`
That is the correct way to generate a projection, you don't have to make a separate projection.
so, the issue comes only during publishing (when generating appxbundle via visual studio) in release mode. When I run the program directly form Visual Studio it works fine both in release mode and debug mode.
That is strange, could you attach a binlog?
I'm also trying to reference Windows.winmd in .Net 6, but can't get it to work. Any suggestions? I've installed CsWinRT.
C#/WinRT excludes Windows by default.
Hi Team,
I am using below api in .Net Framework based project ( Centennial app ).
have added a .winmd reference for this. This api mainly used in Windows Teams OS ( specially meant for Surface Hub devices).
While migrating to .NET 6.0 I started facing below issue -
This api(Windows.UI.Core.Preview.Communications.PreviewTeamDeviceCredentials) is available as
Device family | Windows Team Extension SDK (introduced in 10.0.19041.0) -- | -- API contract | Windows.UI.Core.Preview.Communications.PreviewCommunicationsContract (introduced in v1.0)In new project .NET 6.0 TFM is set to
<TargetFramework>net6.0-windows10.0.19041</TargetFramework>
I tried to follow the link https://aka.ms/netsdk1130 but couldn't figure out what needs to be done and seems to be stuck.
can someone please help here?
Is there any sample available which I can refer?