1

I have tried to compile the visual studio 2022 extension with Tool Window. I have followed along in the video by Mads Cristianson to create the project.

enter image description here

I have the extension developer installed.

But in Visual studio I see this.

enter image description here

This is the compile error I am receiving

Severity Code Description Project File Line Suppression State Error CS0246 The type or namespace name 'ToolkitToolWindowPane' could not be found (are you missing a using directive or an assembly reference?) VSIXWithToolWindow C:\temp\Extensions\VSIXWithToolWindow\ToolWindows\MyToolWindow.cs 22 Active

I have tried to register the Microsoft.VisualStudio.Shell assembly as well with no luck

Browsed to this folder

cd "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\PublicAssemblies"

gacutil -i .\Microsoft.VisualStudio.Shell.15.0.dll 

2 Answers 2

3

(At time of writing) this is a bug in the released template, but it has been fixed in the source code repository for the toolkit.

The specific problem is that ToolkitToolWindowPane needs to be renamed to ToolWindowPane, but once that is fixed you'll find there are further problems with the released code. You'll need to update the project with the code from the source repository, and ensure that the Nuget package references within your project are updated to the latest versions.

Note however that there are some parts of the source code (GUIDs and names) that need to be unique to your package so it doesn't clash with any others built from the same source code - check the differences between your templated project and the original source.extension.vsixmanifest, VSCommandTable.vsct, VSCommandTable.cs to see what needs to be changed.

Sign up to request clarification or add additional context in comments.

Comments

-1

You can try the following ways:

1.Try to reproduce creating a new project and check if the problem persists.

2.After closing Visual Studio and deleting the .vs folder under the project folder, reproduce the project to compile.

3.Add a reference to Microsoft.Visual Studio.Shell to the project. enter image description hereenter image description here

4.Try repairing Visual Studio using the Visual Studio installer or resetting Visual Studio using Devenv/Resetting

Update: Use internal class Pane: ToolWindowPane instead of internal class Pane: ToolkitToolWindowPane

12 Comments

I have already tried everything mentioned. This is something specific with the Extension Template pack 2022. It might be something specific with the computer, I am trying to run the compile the code on. Something else ight be causing the conflict.
Hi Stuart Smith, any updates to your issue? And have you found a specific cause for the problem.
Hi @Zhengye Xu , No I do not have a solution for this one as of yet.
Hi @Stuart Smith, I didn't find the toolkittoolwindowpane class in the official documentation, maybe you can try this: <internal class Pane: ToolWindowPane>
Hi @Stuart Smith, just wanted to confirm if there is any progress on your issue and if you have tried the advice I provided. (Use <internal class Pane: ToolWindowPane> instead of <internal class Pane: ToolkitToolWindowPane>)
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.