-
Notifications
You must be signed in to change notification settings - Fork 321
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
Fix issue where WinUI C# and C++ item templates are not appearing in WinUI projects #2599
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it broke again in Version 17.3.0 Preview 2.0 |
@TRadigk Could you explain what you mean? This fix hasn't been released yet so it shouldn't be possible for it to have regressed. |
…ates ## Problem In a [previous PR](#2289), I attempted to prevent the WinUI C# templates from appearing in projects unrelated to WinUI. To do so, I set the [ShowByDefault](https://docs.microsoft.com/en-us/visualstudio/extensibility/showbydefault-visual-studio-templates?view=vs-2022) property to `false`. When this property is `false`, the decision to show/hide the item templates falls to the [AppliesTo](https://docs.microsoft.com/en-us/visualstudio/extensibility/appliesto-element-visual-studio-templates?view=vs-2022) and [TemplateGroupID](https://docs.microsoft.com/en-us/visualstudio/extensibility/templategroupid-element-visual-studio-templates?view=vs-2022) properties. The C# templates currently hold the value `CSharp + SharedAssetsProject`. However, an examination of the capabilities for a WinUI project reveals that `SharedAssetsProject` is no longer present: ![image](https://user-images.githubusercontent.com/59936622/172943854-a7d108ed-453e-4849-844e-170489d4fca7.png) The C++ templates currently hold no value for `AppliesTo` and `TemplateGroupID`. ## Solution For the C# templates, we can adjust the value for `AppliesTo` to be `CSharp + WindowsAppSdk`. For the C++ templates, we can add the property `AppliesTo` with value `VisualC + WindowsAppSdk`. We can also add the property `TemplateGroupID` with value `WinRT-Native-UAP`, which comes from this table ([link](https://docs.microsoft.com/en-us/visualstudio/extensibility/templategroupid-element-visual-studio-templates?view=vs-2022)): ![image](https://user-images.githubusercontent.com/59936622/172949107-b4be14fc-33d1-466c-9227-2d9db61c1643.png) ## C# ![image](https://user-images.githubusercontent.com/59936622/172935775-e1120116-95bc-4f97-8034-53175686e3a3.png) ## C++ ![image](https://user-images.githubusercontent.com/59936622/172939101-6b791b67-d51d-4ca0-acd5-6014474f03ca.png) ## Work Item microsoft/microsoft-ui-xaml#7148 (cherry picked from commit ea92f45)
…ates (#2641) ## Problem In a [previous PR](#2289), I attempted to prevent the WinUI C# templates from appearing in projects unrelated to WinUI. To do so, I set the [ShowByDefault](https://docs.microsoft.com/en-us/visualstudio/extensibility/showbydefault-visual-studio-templates?view=vs-2022) property to `false`. When this property is `false`, the decision to show/hide the item templates falls to the [AppliesTo](https://docs.microsoft.com/en-us/visualstudio/extensibility/appliesto-element-visual-studio-templates?view=vs-2022) and [TemplateGroupID](https://docs.microsoft.com/en-us/visualstudio/extensibility/templategroupid-element-visual-studio-templates?view=vs-2022) properties. The C# templates currently hold the value `CSharp + SharedAssetsProject`. However, an examination of the capabilities for a WinUI project reveals that `SharedAssetsProject` is no longer present: ![image](https://user-images.githubusercontent.com/59936622/172943854-a7d108ed-453e-4849-844e-170489d4fca7.png) The C++ templates currently hold no value for `AppliesTo` and `TemplateGroupID`. ## Solution For the C# templates, we can adjust the value for `AppliesTo` to be `CSharp + WindowsAppSdk`. For the C++ templates, we can add the property `AppliesTo` with value `VisualC + WindowsAppSdk`. We can also add the property `TemplateGroupID` with value `WinRT-Native-UAP`, which comes from this table ([link](https://docs.microsoft.com/en-us/visualstudio/extensibility/templategroupid-element-visual-studio-templates?view=vs-2022)): ![image](https://user-images.githubusercontent.com/59936622/172949107-b4be14fc-33d1-466c-9227-2d9db61c1643.png) ## C# ![image](https://user-images.githubusercontent.com/59936622/172935775-e1120116-95bc-4f97-8034-53175686e3a3.png) ## C++ ![image](https://user-images.githubusercontent.com/59936622/172939101-6b791b67-d51d-4ca0-acd5-6014474f03ca.png) ## Work Item microsoft/microsoft-ui-xaml#7148 (cherry picked from commit ea92f45) Co-authored-by: James Parsons <japarson@microsoft.com>
It seems that I have missed reading this important reply. Thanks for your patience. The original reply: @evelynwu-msft Hello. Sorry to disturb you. I use VS 17.3 preview 2 but the same issue encountered. Pictures: Template missing: The elementary WinUI VS extensions has been installed: I use VS 17.3p2: Templates has been successfully installed. I don't think that the issue has been fixed in the current version. 😞 |
Thanks for the information. I was quite certain I had no trouble working with the templates recently, thus assuming prior the latest VS preview update. |
@TRadigk This will be addressed in the upcoming servicing update for 1.1. Unfortunately, the only workaround until then is to install the WinAppSdk 1.0.4 extension (C# Visual Studio 2022 extension and C++ Visual Studio 2022 extension) and manually upgrade the package version when creating a new project (the package upgrade step can be skipped if you're working with an existing project). |
@TRadigk My mistake, the servicing update with the fixed templates has already been released; updating your installed extension to 1.1.2 should resolve this problem for you: C# Visual Studio 2022 extension and C++ Visual Studio 2022 extension. |
Problem
In a previous PR, I attempted to prevent the WinUI C# templates from appearing in projects unrelated to WinUI. To do so, I set the ShowByDefault property to
false
. When this property isfalse
, the decision to show/hide the item templates falls to the AppliesTo and TemplateGroupID properties.The C# templates currently hold the value
CSharp + SharedAssetsProject
. However, an examination of the capabilities for a WinUI project reveals thatSharedAssetsProject
is no longer present:The C++ templates currently hold no value for
AppliesTo
andTemplateGroupID
.Solution
For the C# templates, we can adjust the value for
AppliesTo
to beCSharp + WindowsAppSdk
.For the C++ templates, we can add the property
AppliesTo
with valueVisualC + WindowsAppSdk
. We can also add the propertyTemplateGroupID
with valueWinRT-Native-UAP
, which comes from this table (link):C#
C++
Work Item
microsoft/microsoft-ui-xaml#7148