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

does it happen consitently on thos VS 2017 installations? you could try installing Microsoft.Net.Core.SDK.2.1 manually on one to see if that makes the problem go away

you might also like to file an issue through VS's Report a Problem button

Veselin Ivanov
@vvatkov

@yannduran interestingly, vsix installer fails with System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.Setup.PackageFailureException: Package 'Microsoft.Net.Core.SDK.2.1' failed to install even if the vsixmanifest has no dependencies or prerequisites :) happens on some installations on VS 2017

Similar error is reported to Visual Studio Community. So make sure you have the latest version of Visual Studio 2017. Also you can try repairing or completely reinstalling the instance.

Matt Lacey
@mrlacey
How/should I unsubscribe from events on IWpfTextView? As a specific example, I have an IntraTextAdornmentTagger based on the sample. This subscribes to events on the view passed to the tagger (https://github.com/microsoft/VSSDK-Extensibility-Samples/blob/346f5b0289e5fb8de639ba96fb10703df06cd22d/Intra-text_Adornment/C%23/Support/IntraTextAdornmentTagger.cs#L46) but these events aren't ever unsubscribed. Is this a problem? How/should I unsubscribe?
yangdehua1981
@yangdehua1981
Hello everyone, how to get its level according to compilation warning, for example: c4652 level is 1
Yann Duran
@yannduran
@mrlacey didn't Mads answer someone's question recently in oneof his youtube videos about unsubscribing from events? my recollection is that he said as long as you're not holding a reference to an event tat it'll just end up getting garbage collected, and that was ok
Matt Lacey
@mrlacey
@yannduran I remember something like that too. Just found a comment in my code with a todo saying "unsubscribe from these events" but not sure how. Transcripts from the videos @madskristensen does, would be really helpful for looking things like this up.
Matt Lacey
@mrlacey
Have now found https://github.com/madskristensen/MarkdownEditor/blob/master/src/Parsing/MarkdownDocumentView.cs which uses the TextView closed event to unsubscribe from the other events
Christopher Christou
@awschristou

I'm working on an extension that has a ToolWindow and a Team Explorer integration. If Visual Studio starts up with the Team Explorer panel visible and this extension's ToolWindow not visible, the Team Explorer portion of the extension initializes, but the main extension Package is not initialized until the ToolWindow is shown.

Is there a way to force activate the Package if needed when the Team Explorer code is activated?

Matt Lacey
@mrlacey
Try something like this to forcibly load a package

if (ServiceProvider.GlobalProvider.GetService(typeof(SVsShell)) is IVsShell shell)
{
    Guid PackageToBeLoadedGuid = new Guid(YourPackage.PackageGuidString);
    shell.LoadPackage(ref PackageToBeLoadedGuid, out _);
}
Christopher Christou
@awschristou
Thank you @mrlacey that looks great!
Yann Duran
@yannduran
@awschristou you could also try a Rule-based UI Context, with one of the KnownUIContexts
Авдеев Вячеслав
@lsoft
I get a difficulties to apply a VS style to my regular combobox. A try to use VSComboBox (native VS combobox) does not successed too. Any ideas how to create correctly styled combobox, guys?
1 reply
Nathan H. Bean
@zombiepaladin

@zombiepaladin Maybe this will return what you need? Environment.UserDomainName

@InTheCloudDan , that gets the signed-in Windows user, which might be the same user as the university user. But if they had their own laptop with a different user before they installed Visual Studio, it would not be the Microsoft account they signed into Visual Studio with...

Adrien Guinet
@aguinet
hello everyone! We'd like to build a VS2017 extension using VS2019, but VCTargets has been deprecated in VS2019. Is there any way to tell VS2019 to build in "VS2017 compatibility mode", or do we need to install VS2017 just to build that extension? Thanks!
Yann Duran
@yannduran
@zombiepaladin I tried to find a way to do this too some time back, but I never found an actual way to do it.
Chris Varone
@Vero1010110_twitter
@aguinet I have to deal with this situation, in terms of keeping compatibility, it's very hard to maintain honestly. The best advice I can offer you is if you can build in VS2017 then it will build on VS2019 and be able to run on VS2017. The most common issue if developing new features and finding out this API does not exist in VS2017.
Matt Lacey
@mrlacey
@aguinet you can build with VS2019 (v16) and support VS2017 (v15) but you'll need VS2017 installed to test it.
Авдеев Вячеслав
@lsoft
guys, does anyone know whendte.Events.FindEvents.FindDone fires? I can't force it to fire, nor ctrl+f, neither ctrl+shift+f fires that event. (they are not GCed) build events works fine...
Glenn Gutay
@ggutay
Hi Everyone, Just a quick question, is it possible to extend property window in Visual Studio, I want to create an extension that will add other items aside from the normal File Name, Full Path Build Action etc. If yes, kindly share sample code.
Ed Dore
@EdDore
@ggutay , I believe this can still be done by implementing and registering a custom IExtenderProvider. It's been at least 15 yrs since I built one of those as a prototype for a customer. Unfortunately, I don't have any examples laying around. It would have probably been of limited use anyway, as I think I implemented it as an AddIn (which was an extension point removed several major versions ago). But I suspect if you query github or run an internet search on "IExtenderProvider" and "RegisterExtenderProvider", you may get some useful hits.
Layne Smashnuk
@lsmashnuk:matrix.org
[m]
@ggutay: I need to be able to do the same in my VS extension. I would be willing to share code with you. I have done some searching but examples are sparse.
Heras
@Heras
I'm developing an extension that will extend the Clean Solution operation with deleting bin & obj folders.
Sadly, so far it's been an extremely frustrating expreience :( because my solution doesn't work most of the time, and then suddenly, works once, and then again doesn't.
Currently, my solution almost always successfully breaks at InitializeAsync where I subscribe to BuildEvents.OnBuildDone.
But when CleanSolution has finished, my code almost never fires, except after I have rebuilt, cleaned, swiped, reset the EXP, went back and forth through git versions, and then it sometimes out of nowhere, works once, and then it doesn't.
This way, I just cannot finish my extension. With every small change I make, it takes me hours to have it run succesfully just once.
Code is at https://github.com/Heras/delete-bin-obj
Anybody has any idea why this is happening to me?
Авдеев Вячеслав
@lsoft
@Heras do you save a reference to BuildEvents somewhere?
looks like your problem is your BuildEvents is GCed, which is known difficulty.
GCing events is solved in Mads Kristensen's community project; consider switching to it
Heras
@Heras
@lsoft 💯it seems you nailed my problem! I did keep a reference to the DTE but not the BuildEvents themselves. Now that I did, the event fired successfully immediately. Thanks so much!
Kaveesh Dashora
@kaveeshd
Has anyone tried with DPI fix for winforms which are a displayed through an extension? Any suggestion where could we call EnableVisualStyles()? https://docs.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8#:~:text=Starting%20with%20the%20.,control%20and%20the%20CheckedListBox%20control.
Adrien Guinet
@aguinet

@aguinet I have to deal with this situation, in terms of keeping compatibility, it's very hard to maintain honestly. The best advice I can offer you is if you can build in VS2017 then it will build on VS2019 and be able to run on VS2017. The most common issue if developing new features and finding out this API does not exist in VS2017.

Thanks for your answer! We ended up by installing both VS2017/2019 build tools + extension SDK in our builder..

Kaveesh Dashora
@kaveeshd
I am trying to put a WPF based UserControl in a IPropertyPage. I use it for my Project Properties dialog. If my UserControl is based on Winforms it works fine, however it has DPI issues. A WPF based UserControl does not display itself. I have tried using UIElementDialogPage, that also does not help. Any suggestions how should I solve this issue?
Yann Duran
@yannduran
@kaveeshd UIElementDialogPage is for Tools | Options pages
Kaveesh Dashora
@kaveeshd
@yannduran I thought so. Is there any other way to use wpf usercontrol with IPropertyPage? I am considering using ElementHost.
Wh0DKnee
@Wh0DKnee
I'm trying to find out when ITagger::GetTags() is called, I'm implementing a Tagger that needs to update tags even when the buffer hasnt changed - is there a way for me to force a call to GetTags()?
4 replies
Sajal Verma
@sajalverma17
Hi everyone,
Is it possible to change the icons of the items visible in Solution Explorer? Or in general, change the look and feel of the items in Solution Explorer hierarchy somehow? I am developing a plugin that somehow "marks" some files in Solution Explorer on my VSPackage initialization, and I am unable to find any APIs/samples to do so.
Yann Duran
@yannduran
@kaveeshd I haven't done any IPropertyPages sorry
Yann Duran
@yannduran

Just to clarify are you trying to add a tab to the project properties tab? Or to the properties window?

Maybe VS2019 Add Project Property page could help point you in the right direction, if you haven't seen it already? Or Modifying project properties of custom project system in VisualStudio ? They may not be exactly what you need, but something may spark an idea.

@sajalverma17 Mads Kristensen's File Icons extension does something similar I think. So maybe the code in it will help you to do what you're trying to do.
Kaveesh Dashora
@kaveeshd
@yannduran Thanks, I was able to use WPF based user control with the ElementHost control in WinForms. I already had created the whole property page with WinForms and it worked fine. However, the issue which caused me to rethink the UI was high DPI screens e.g. a 1080p screen with 125% Scaling on Windows 10. Traditional WinForms controls do not scale well and the controls look for overlapped. Thankfully, I was able to resolve it by creating a WPF based user control and use it via the ElementHost in WinForms. It scales correctly after that, even on a scaling of 300% on a 2160p screen.
Robert van der Hulst
@RobertvanderHulst
I found a problem with the Microsoft.VisualStudio.SDK package version 15.9.3 from the https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json source.
It has a dependency on a VS 2019 (16.*) version of Microsoft.VisualStudio.CoreUtility. If you use this package then your code will no longer run on VS 2017 !
liors619
@liors619
hi everyone, where can i see a list of all the services VS provides to me as extender?
not all but a good list
Jakub Míšek
@jakubmisek

Another info for anyone providing extension for VS2017; once you have AllUsers="true" in your vsixmanifest, vsixinstaller gets to the point where it wants to install (not repair, not update) Microsoft.NET.Core.Sdk.2.1 which fails (because the user has usually a slightly different version of this package already installed - seems more like a version mismatch in Visual Studio 2017 catalog itself). Your extension gets installed, but VSIXInstaller reports a failure.

This can be replicated with @madskristensen 's Extensibility Tools (https://marketplace.visualstudio.com/items?itemName=MadsKristensen.ExtensibilityTools) .
Once the user runs Visual Studio Installer and repairs their installation, things will work well (but just once).

liors619
@liors619
thanks :)
Jakub Míšek
@jakubmisek
I was actually poking Mads to make it working :))
Sajal Verma
@sajalverma17
@yannduran Really appreciate the pointers. Thanks! I checked out FileIcons On first look, it seems to be updating registry for each file extensions. I guess I will have to see if this is feasible for my plugin as I am trying to dynamically mark/unmark .cs files in solution explorer based on a button provided by my plugin.
Robert van der Hulst
@RobertvanderHulst
Is there any news about what this means for extension developers?
Wh0DKnee
@Wh0DKnee
Theres built-in functionality to pin a watch window when you hover over a variable when debugging - is there any way I can invoke this behavior from code?
example.png
That little watch window that shows x = 5 and the little pin next to it. Ideally, I want to open the window and click the pin programatically.