Repository navigation
Replies: 1 comment 1 reply
|
This may now be partly addressed by recent CsWinRT 3.0 packaging changes, although the exact result depends on whether your interface package is a CsWinRT reference projection or a custom WinMD package. Two relevant changes landed very recently:
If your package is using the CsWinRT 3.0 reference-projection model, I would first try the latest package containing those changes and inspect the restored package to confirm the If this is instead a custom NuGet that merely ships an arbitrary WinMD plus a projection DLL, those changes may not cover it. In that case the useful next diagnostic is the evaluated MSBuild graph for the CsWinRT project: check whether the |
Uh oh!
There was an error while loading. Please reload this page.
Hi hopefully someone knows the proper way to solve this or perhaps is a bug?
I've been authoring a number of C++/WinRT components projected and packed in NuGets for a year+ and ran into a problem with custom interfaces also packed in NuGets for internal use. The problem is that when I try to build the projection of a component using interfaces from the NuGet, CsWinRT aborts with the error:
EXEC : error : 'Type 'MyInterfaces.IAnInterface' could not be found' when processing MyNamespace.MyComponet
I'm also including the NuGet in the CsWinRT project. The interface .WinMD file is where it should be in the NuGet structure and listed in the corresponding .target file because a regular C# apps and C++/WinRT components can see the namespace and use the interfaces. For example, If I hardcode the reference to the interface .WinMD in the projection .csproj like this:
The Item group above in the projection .csproj works reliably as a temporary workaround. Those references are repeated in the .targets file of the intefaces NuGet like this:
The ItemGroup above is in the .targets file under the NuGet build directory where C# code looks for, and works perfectly in a normal C# app, but interstingly, in the CsWinMD project, only the projection dll is added to the referenced assemblies but the .WinMD reference is ignored, resulting in the compile error listed above.
All reactions