Replies: 3 comments 2 replies
-
I generated a C# projection from a C++/WinRT component to distribute as a NuGet package for .NET 5+ applications and need to use it in a WinUI 3 Desktop App. PROJECT_A is a C++ Windows Component (WinUI 3) I have added, as projects, PROJECT_A and PROJECT_B (as an existing item, referenced them by drilling back-then-down to their respective project file). I then added "PackageReference Include="PROJECT_A" Version="0.1.0-prerelease"" to the PROJECT_C.csproj file. I had to add the following to the .csproj so Visual Studio 2022 Preview could locate the "PROJECT_A.0.1.0-prerelease.nupkg" file: PropertyGroup I can see PROJECT_A in NuGet Package Manager and is installed for the project in question. I can see it as one of the Packages in Dependencies. But, neither #using PROJECT_A or #using PROJECT_B work, I get the following: Error CS0246 The type or namespace name 'PROJECT_A' could not be found (are you missing a using directive or an assembly reference?) Character Map C:\Source\Code\Windows\10\WinUI 3\Fonts\PROJECT_C\PROJECT_C\MainWindow.xaml.cs Also added PROJECT_B's project as a reference, no luck - #using did not work. So, I referenced PROJECT_A's project (#using worked) but get the following : Error NETSDK1130 PROJECT_A.winmd cannot be referenced. Referencing a Windows Metadata component directly when targeting .NET 5 or higher is not supported. For more information, see https://aka.ms/netsdk1130 Character Map C:\Program Files\dotnet\sdk\6.0.100-rc.1.21463.6\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets Reference: https://docs.microsoft.com/en-us/windows/uwp/csharp-winrt/net-projection-from-cppwinrt-component What to TRY NEXT ??? |
Beta Was this translation helpful? Give feedback.
-
Hey @duncanmacmichael, can you help answer whether DWriteCore will be usable by C# apps or whether it's only usable from C++? |
Beta Was this translation helpful? Give feedback.
-
Can you please edit this discussion title to NOT BE IN ALL CAPS? Thanks. It keeps landing in my inbox with all caps. |
Beta Was this translation helpful? Give feedback.
-
WHAT IS THE PROPER WAY TO CODE A "CLASS LIBRARY", IN VISUAL STUDIO 2022 PREVIEW (or 2019), THAT NEEDS TO USE C++ (to access DWriteCore) FROM MANAGED CODE (C#) ?
Is DWriteCore just for CPP apps?
Will a Managed Code implementation of the interface be coming in the future?
I need to get font information, and this interface has the functions and controls, and I'm using WinUI 3 Desktop, Windows App SDK (WindowsAppSDK - Experimental) , Visual Studio 2022 Preview.
I just need to know, since my app needs access to system font information (collections) - Am I - forced to go entirely CPP (looks to be), partial CPP - partial C#, or entirely C# (preferred)?
Beta Was this translation helpful? Give feedback.
All reactions