Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C# projection does not recognize Guid type declared from C++/WinRT component #1286

Closed
RobsonPontin opened this issue Jan 20, 2023 · 0 comments · Fixed by #1288
Closed

C# projection does not recognize Guid type declared from C++/WinRT component #1286

RobsonPontin opened this issue Jan 20, 2023 · 0 comments · Fixed by #1288
Assignees
Labels
bug Something isn't working
Milestone

Comments

@RobsonPontin
Copy link

RobsonPontin commented Jan 20, 2023

Describe the bug
Declaring a Guid (winrt::guid) type in the C++/WinRT IDL file, to create a WinRT projection, will cause the C# projection to complain about not finding the namespace for it.

To Reproduce

  1. In the idl file of a C++/WinRT component declare a new method/delegate which passes a Guid type argument

Example:
delegate void MyDelegate(IInspectable parameter, Guid guid);

  1. Try to compile and generate the C# projection and the following error will be displayed:

C:\src\MyCSProject\obj\x64\Debug\net6.0-windows10.0.19041.0\Generated Files\MyExampleFile.cs(775,123,775,127): error CS0246: The type or namespace name 'Guid' could not be found (are you missing a using directive or an assembly reference?)

Expected behavior
I would expect the Guid type to be recognized in the C# .NET projection.

Version Info

  • Microsoft.Windows.CsWinRT: v2.0.1
  • Microsoft.Windows.SDK.BuildTools: v10.0.22621.755
  • Microsoft.WindowsAppSDK: v1.2.221116.1
  • .NET: net6.0-windows10.0.19041.0
@RobsonPontin RobsonPontin added the bug Something isn't working label Jan 20, 2023
@manodasanW manodasanW self-assigned this Jan 20, 2023
@manodasanW manodasanW added this to the Release 2.0.2 milestone Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants