Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Yann Duran
@yannduran

Starting from scratch with 0 reviews etc is not ideal

I agree!

Thomas Zitzler
@ThomasZitzler

Hi, I'm trying to update one of my extensions to VS 2022, but it's crashing at the end when trying to open a help page:

dte.ItemOperations.Navigate("https://myhelppage", vsNavigateOptions.vsNavigateOptionsNewWindow);

The error message is: Method not found: 'EnvDTE.ItemOperations EnvDTE._DTE.get_ItemOperations()'.

Can I replace this with something else?

Авдеев Вячеслав
@lsoft
@ThomasZitzler what's the type of dte ? it should be DTE2
Thomas Zitzler
@ThomasZitzler
@lsoft I'm using it in ProjectFinishedGenerating(Project project) in an IWizard and just use project.DTE
Авдеев Вячеслав
@lsoft
did you watch Mads Kristensen's show episode about supporting vs2022?
Thomas Zitzler
@ThomasZitzler
Авдеев Вячеслав
@lsoft
the eldorado is here: https://www.youtube.com/playlist?list=PLReL099Y5nRdG2n1PrY_tbCsUznoYvqkS I think it will help you a lot if you watch at least some of that episodes. take a look specifically to https://www.youtube.com/watch?v=-PKIPTW6km0&list=PLReL099Y5nRdG2n1PrY_tbCsUznoYvqkS&index=5
Thomas Zitzler
@ThomasZitzler
@lsoft Thank you very much
Авдеев Вячеслав
@lsoft
I've converted all of my vsix with no problem after watching that.
come back if any difficulties arise))
Andy Hippo
@werat
@vasantha-kumar25 Hi, sorry it took me soooo long, but I finally got the time to describe the process of installing VSIX from MSI -- https://werat.dev/blog/installing-visual-studio-extensions-from-msi/
I hope it helps you!
takko
@takko
Hi, is there any way to add a separator or an unselectable item to a combobox?
www.software.tirol
@softwaretirol
Hey everyone, is it possible to disable the design time features for *.razor files in some way? Thanks!
Robert van der Hulst
@RobertvanderHulst
@werat Thanks for sharing this.
Nils Andresen
@nils-a
Hi People, I am working on an extension and I somehow "broke" the commands which means all of my commands/menus are gone (do not appear) is there some way of enabling verbose logging or debug what is happening?
4 replies
Robert van der Hulst
@RobertvanderHulst
Does anybody know or have a link to documentation about what a 3rd party development language has to do / has to implement to support Edit and Continue ( and in the future also Hot Reload) in Visual Studio.
I know that I can find some information by looking at what the Roslyn team has done, but some documentation would be helpful.
Aleksandr
@aldanchenko
Hi,
In my extension I need to get file text by file name (path), line and start/end columns. How can I get this information? Which VS classes can I use for this? Thank you!
Авдеев Вячеслав
@lsoft
@aldanchenko why do you need VS classes to operate with a file which path is known and the position inside it is also known... can you expand your question?
@aldanchenko also, if we are talking about c# source file, roslyn has such stuff (to get text by position)... what kind of file is? is the file is in solution or not?
8 replies
Crypties
@Crypties
What would be the different ways to change the Status bar colors dynamically? It has to be lite and not slow down VS, so I guess nothing like Reapplying a modified theme.
Авдеев Вячеслав
@lsoft
hello! does anyone know how to get solution filter name (name of slnf file) from vsix? dte.Solutioncannot help... VS show slnf on its main screen, but how to grab this info from vsix is completely unclear
baggiochen10
@baggiochen10
hi, does anyone know how to communicate with another vsix, or call?
and if we can use web controll in our vsix?
3 replies
Kaveesh Dashora
@kaveeshd
I have a toolbox where I am displaying custom search results, Everything works fine. I want to extend that functionality to support the Find Next and Find Previous options through hotkeys. Is there a way to do that?
John J. DeFalco
@YahtzeeJD
image.png
can I change these icons via an extension?
2 replies
Erik Ejlskov Jensen
@ErikEJ
Why would you want to use a Microsoft.VisuslStudio.SDK version higher than 16.0 in an extension targeting VS 2019?
1 reply
Brian
@astrohart
Hi all! Name's Brian, I am new.

I am currently working on a custom multi-project template for VS that I want to use a Wizard Extension with in order to prompt the user to selectively generate the projects. To do so, I've implemented a Root Wizard (RootWizard class) and Child Wizard (ChildWizard class). The ChildWizard class is configured in the .vstemplate file of each project to be generated, and the RootWizard is provided in a WizardExtension template in the top-level .vstemplate file. Both RootWizard and ChildWizard have some stuff in common...such as Configuration, logging etc. I wanted to derive an ABSTRACT class, WizardImplBase that implements IWizard abstractly, and then derive RootWizard and ChildWizard off of it. When I do so, however, and then run the Create New Project process in VS, then I bump into the error that VS says "There is no RootWizard class in assembly MyProjectWizard.dll".

Do the Create New Project flow and .vstemplatenot play nice with an abstract base class implementing IWizard?

Brian
@astrohart
When I push everything down from the abstract class to the child classes it works, but it's a lot of code redundancy.
Andreas Schmitt
@VacuumBreather
Does anybody have a good resource to get started with custom editor development? Our plan is to have a custom XAML/Preview editor for a custom XAML implementation. However all the MSDN documentation on this topic is hopelessly outdated and reverse engineering this stuff from other github projects and samples is proving to be only partially helpful. I haven't been able to find any decent resource on this subject that goes through it step by step. Finished examples are not really helpful since it's not immediately obvious what the basics are which are absolutely necessary and what is custom to the sample, whether used GUIDs are project specific or stand for something defines by the SDK and if so where to find those definitions.
If anybody knows a good step by step documentation/tutorial/video/anything on custom editor/designer development I'd love to hear about it.
1 reply
Brien King
@BrienKing
Howdy, anyone awake? :)
I currently have some ugly code that I use to get the IDesignerHost for Winforms, I'm wondering if there is a better way to get it?
Frank Naumann
@FNaumann_gitlab

Hello.
What I am asking for is just a hint to the right approach to solve my task.
I have started to develop a VS extension to simplify the recurring implementation of state machines.
Creating an "Item Template Wizard" was no problem. It creates the folder structures , copies the default files and adjusts their contents, eliminates optional files if they are not needed. So far so good.

But for the further steps the approach of the "Item Template Wizard" seems to be not sufficient.
I want to be able to enter a list of states on the wizard dialog and add a file State.<Statusname>.cs to the project for each state.
Additionally the state should be added to the enumeration StatemachineX.States.cs and some special adjustments should be done in StatemachineX.Main.cs.

Of course, I want to reuse the code to add individual states during development. But that is a task for the future.

The following illustration shows the project part to be created:

Solution
|
+-[Project]
+- ...
+- any other project files
+- ...
+-[StatemachineX]
+-[Options]
+- ...
+- any optional files // default files
+- ...
+-[Defines]
+- StatemachineX.States.cs // default file
+- StatemachineX.Events.cs // default file
+-[States]
+- State.Base.cs // default file
+- State.XXXX.xs // default file
+- State.X1 //
+- State.X2 // according to the states enumeration ...
+- State.X3 // defined by the developer
+- ... //
+- State.Xn //
+-StatemachineX.Main.cs // default file - main class of the state machine

If someone has the solution ... please don't tell (before I beg on my knees).
Links to solution approaches on the other hand ...

bert2
@bert2

Hi everyone, I'm trying to get my extension ready for 2022 and I'm having issues with the settings manager.

I'm using Mads' BaseOptionModel. Everything worked fine in 2019, but in 2022 it's throwing in this line when trying to lazily create the AsyncLazy<ShellSettingsManager> _settingsManager.

The exception is a MissingMethodException claiming that ShellSettingsManager doesn't have a ctor that takes an IVsSettingsManager. But judging from the message, the exception acutally seems to relate to this line.

7 replies
Brien King
@BrienKing
Does the Microsoft.VisualStudio.SDK not support class libraries?
Libraries are Framework 4.8
Brien King
@BrienKing
When I try to add the Nuget Package Microsoft.VisualStudio.SDK it fails with "Could not install package 'Microsoft.ServiceHub.Analyzers 2.8.10'. You are trying to install this package into a project that targets ..."
Brien King
@BrienKing
Well, I cheated and added a new VSIX project and will use that as the starting point for my Library. Apparently the Template will add the NuGet Packages, but it doesn't seem like you can add them to a normal Library project.
Brien King
@BrienKing
Well, I have a rather annoying issue. This code:
        PropertyDescriptor propInfo = null;

        propInfo = TypeDescriptor.GetProperties(p_component)["Name"];
        propInfo.SetValue(p_component, p_newName);
fails in the Experimental Visual Studio (when debugging), but works just fine in Visual Studio if I install the Extension.
p_component is the new control I created via designerHost.CreateComponent
I take that back, p_component is an existing control I got from the designer host.
The error I get is:
Code generation for property 'FormatType' failed. Error was: 'Type 'Warp10.DeveloperExpress.Controls.EditControls.TextEdit+FormatTypes' is not available in the target framework.'
Brien King
@BrienKing
Which is weird because that's not the control that I am renaming.
Aleksandr
@aldanchenko
Hi everyone 👋, could someone know is it possible to set ToolWindow open by default? I mean if user install an extension and open VS it will see ToolWindow (without open it from View menu item). Something like Style = Microsoft.VisualStudio.Shell.VsDockStyle.Tabbed property. Thanks! 🙏
4 replies
Christopher Christou
@awschristou
Is it possible to start with an IVsHierarchy (x) for an arbitrarily selected item in the Solution Explorer and determine an IVsHierarchy (p) for the project that x belongs to? I'd like to understand how to do this without using EnvDTE. I've tried using GetProperty and __VSHPROPID.VSHPROPID_ParentHierarchy without success.
1 reply
nathvi
@nathvi

Hey guys, I've implemented this before using reflecting and attributes, but I'm curious if someone has done something like this before.

Basically, anytime a class implements an interface, visual studio autogenerates a static "IFactoryGenerator" class, and appropriate overridden "Create" methods.

The crude way I did it before was, reflect over the codebase for any class tagged with "CreateFactory" attribute, and then generate a "IFactoryGenerator" static class, with pass through implementations.