Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion dev/VSIX/Extension/Cpp/Common/VSPackage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions dev/VSIX/Extension/Cpp/Common/VSPackage.resx
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,10 @@ For more details on the error, check the General tab in the Output window.</valu
<data name="1052" xml:space="preserve">
<value>Please manually add package references before building.</value>
</data>
<data name="1053" xml:space="preserve">
<value>General</value>
</data>
<data name="1054" xml:space="preserve">
<value>No output information available.</value>
</data>
</root>
20 changes: 19 additions & 1 deletion dev/VSIX/Extension/Cs/Common/VSPackage.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion dev/VSIX/Extension/Cs/Common/VSPackage.resx
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,10 @@
<data name="1052" xml:space="preserve">
<value>Please manually add package references before building.</value>
</data>
</root>
<data name="1053" xml:space="preserve">
<value>General</value>
</data>
<data name="1054" xml:space="preserve">
<value>No output information available.</value>
</data>
</root>
19 changes: 13 additions & 6 deletions dev/VSIX/Shared/OutputWindowHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;

// Although the strings are the same in the wizard for both extensions,
// they are included with both their respective VSPackages.
// Strings for both extensions can be found in {PathToWindowsAppSDK}\dev\VSIX\Extension\Cs\Common\VSPackage.resx
Copy link

Copilot AI Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment only references the C# VSPackage.resx path but should also mention the C++ path since both extensions have their own resource files. Consider updating to: 'Strings for both extensions can be found in {PathToWindowsAppSDK}\dev\VSIX\Extension\Cs\Common\VSPackage.resx and {PathToWindowsAppSDK}\dev\VSIX\Extension\Cpp\Common\VSPackage.resx'

Suggested change
// Strings for both extensions can be found in {PathToWindowsAppSDK}\dev\VSIX\Extension\Cs\Common\VSPackage.resx
// Strings for both extensions can be found in {PathToWindowsAppSDK}\dev\VSIX\Extension\Cs\Common\VSPackage.resx and {PathToWindowsAppSDK}\dev\VSIX\Extension\Cpp\Common\VSPackage.resx

Copilot uses AI. Check for mistakes.
// Wizard strings are numbers 1044 and above.
#if CSHARP_EXTENSION
using Resources = WindowsAppSDK.Cs.Extension.Dev17.VSPackage;
#elif CPP_EXTENSION
using Resources = WindowsAppSDK.Cpp.Extension.Dev17.VSPackage;
#endif

namespace WindowsAppSDK.TemplateUtilities
{
internal static class OutputWindowHelper
Expand All @@ -17,37 +27,34 @@ internal static class OutputWindowHelper
public static void ShowMessageInOutputWindow(string message, bool clearPane = true)
{
ThreadHelper.ThrowIfNotOnUIThread();

// Log to Output window
IVsOutputWindow outputWindow = ServiceProvider.GlobalProvider.GetService(typeof(SVsOutputWindow)) as IVsOutputWindow;
if (outputWindow != null)
{
Guid guidGeneral = Microsoft.VisualStudio.VSConstants.GUID_OutWindowGeneralPane;
IVsOutputWindowPane pane;
int hr = outputWindow.GetPane(ref guidGeneral, out pane);

// Create pane if it doesn't exist
if (pane == null)
{
hr = outputWindow.CreatePane(ref guidGeneral, "General", 1, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am again realizing how I don't like the fact that the Resources class uses numbers as the name of the properties that return the strings we want. This makes it a bit hard to read. I would love if this was something like Resources.GeneralTitleString.

Copy link
Member Author

@lauren-ciha lauren-ciha Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I've created this issue to capture this improvement so we can work on it in another PR.

hr = outputWindow.CreatePane(ref guidGeneral, Resources._1053, 1, 1);
if (hr == Microsoft.VisualStudio.VSConstants.S_OK)
{
outputWindow.GetPane(ref guidGeneral, out pane);
}
}

if (pane != null)
{
pane.Activate();
if (clearPane)
{
pane.Clear();
}
pane.OutputStringThreadSafe(message ?? "No error details available.");
pane.OutputStringThreadSafe(message ?? Resources._1054);
pane.OutputStringThreadSafe("\n");
}
}

// Show the Output window
var dte = ServiceProvider.GlobalProvider.GetService(typeof(EnvDTE.DTE)) as EnvDTE.DTE;
if (dte != null)
Expand Down