Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Daniel Griffen
@dgriffen
@JohanLarsson VS2019 runs on net472 so extensions targeting it are safe to target net472 as well.
Johan Larsson
@JohanLarsson
thanks
Kaveesh Dashora
@kaveeshd

Hi, I am trying to create a properties page for my project. I started with creating the dialog with WPF UserControl. After creating the dialog, implemented the IPropertyPage interface. With WPF running the dialog came back empty. If I try the same thing on WinForms. It works fine.

I am using the following link - https://docs.microsoft.com/en-us/visualstudio/extensibility/adding-and-removing-property-pages?view=vs-2019

Is there any thing special to be done for WPF UserControl or property pages are limited to winforms only?

Yann Duran
@yannduran

@kaveeshd you might find this VS-SDK-Extensibility-Sample helpful

in a nutshell, you don't implement IPropertyPage directly, you inherit from DialogPage, but this sample takes things to another level, and shows best practices for options pages

Cameron
@cameron314
@kaveeshd Property pages are WinForms-based. I suppose there's nothing preventing you from hosting a XAML control within a WinForms page, though
Yann Duran
@yannduran
do you need to create custom ui? the OtherOptions page shows how to display properties in an automatic grid
pkruk2
@pkruk2
Hi, is there a reason why AsyncPackage.GetToolWindowTitle is not called?
Yann Duran
@yannduran
@pkruk2 i've wondered about the usefulness of that method myself. personally i don't believe it's necessary, but don't quote me on it
@cameron314 options pages don't have to be winforms-based, you can create custom wpf ui quite easily
Cameron
@cameron314
@yannduran Really? Was this introduced after VS2015? Also, property pages are not the same as option pages
Yann Duran
@yannduran
@kaveeshd my bad, for WPF you inherit from UIElementDialogPage, not DialogPage
@cameron314 sorry, I'm talking about options pages, i misread the original text
Cameron
@cameron314
Cool, didn't know UIElementDialogPage existed :-)
Yann Duran
@yannduran
@cameron314 at least i got something right lol
Cameron
@cameron314
hehe
Yann Duran
@yannduran
this article is a little old now, but the explanation still holds true Setting for Your Visual Studio Extension, just make sure you keep reading till the end
slooker
@slooker
Good morning. Is there a room to ask questions about extensions? My remote wsl just randomly stopped working, and now I'm dead in the water. I've done some investigating, and figured out that for some reason even though I can curl locally on my WSL, I can't curl from my windows machine to WSL on the port that's opened by VSCode. I've tried reinstalling the extension, removing the .vscode-server directory on my WSL, removing the extension properties in my windows box, and checking for updates for both the extension and actual VSCode.
slooker
@slooker
If there's somewhere else someone can recommend, I'd be super appreciative.
slooker
@slooker
For anyone that cares, disabling ipv6 in windows immediately fixed the problem.
Daniel Griffen
@dgriffen
@slooker you might want to open up an issue on the VSCode github, this gitter channel is for Visual Studio, not Visual Studio Code.
Kaveesh Dashora
@kaveeshd
@yannduran Thanks. This helps
Matt Lacey
@mrlacey
@madskristensen watching https://www.youtube.com/watch?v=RgQEfUUHUYw and noticed that you say that any visual studio extension can be made into an extension pack. How does this work? Does it mean I can include a .vsext file in a regular extension and the user will also be prompted to install the referenced extensions at the same time?
Mads Kristensen
@madskristensen
@mrlacey That's exactly right. I do that in my Image Sprites extension and a few others too
James Lavery
@jameslavery
Hi all,
We want to exclude the designer.cs files, generated from RESX files, from our repositories. To achieve this, we need to make VS run the resource generator at project load (because the resource generation tool only runs when a RESX file is changed). This triggers two questions:
  1. Is there already an extension which does this (can't find one).
  2. If not, which SDK class/event can I hook into so I can run the resource generator when a Project loads?
Matthijs ter Woord
@mterwoord
that means no build server either?
James Lavery
@jameslavery
@mterwoord Correct.
Matthijs ter Woord
@mterwoord
just asking.
Out of curiosity: why?
James Lavery
@jameslavery
@mterwoord Erm... because that's how the development environment is set up at this customer?
Matthijs ter Woord
@mterwoord
Don't get me wrong, I'm used to always have automated builds at a server, even its just to verify everythings commited :)
was just curios to learn new visions.. :)
James Lavery
@jameslavery
@mterwoord No problem!
Markus Amshove
@MarkusAmshove
Is it possible to extend the WorkItems in CodeLens somehow, so that it interprets Issues from other trackers? We're using Redmine and I would like to be able to create an extension that mimics the VSTS work item code lens behavior but with information from redmine :-)
Ken Domino
@kaby76

Hi All,
I’ve been writing an extension for Antlr grammars for VS IDE for a couple of years, and now that it works--more or less--I’m interested in writing a new extension targeting at runtime any language via a meta grammar and tables detailing information for tagging, etc.
The problem with this idea is that I use MEF (Managed Extensibility Framework), and virtually all samples that I can find are based in MEF. Unfortunately, MEF works on a statically defined type system, i.e., the types are created upfront then compiled. It attaches C# attributes to describe the language it implements, e.g., the tagger provider and the file suffix associated with the language is hardwired at compile time:

    [Export(typeof(ITaggerProvider))]
    [ContentType(AntlrVSIX.Constants.ContentType)]
    [TagType(typeof(ClassificationTag))]
    internal sealed class AntlrClassifierProvider : ITaggerProvider
    {
        [Export]
        [Name(/* AntlrVSIX.Constants.LanguageName */ "Antlr")]
        [BaseDefinition("code")]
        internal static ContentTypeDefinition AntlrContentType = null;

        [Export]
        [FileExtension(/* AntlrVSIX.Constants.FileExtension */ “.g;*.g4”)] 
        [ContentType(AntlrVSIX.Constants.ContentType)]
        internal static FileExtensionToContentTypeDefinition AntlrFileType = null;
    …
 }

I can, of course, generate a per-language extension via a template, then build the extension. But I was hoping for something that would be more dynamic. Is there something more modern than MEF for implementing VS extensions, something that isn’t based on a static type system framework?
Thanks for the info.
Ken

jcassidyav
@jcassidyav
Momchil Stefanov
@momchilstefanov
Hi guys, I have a VS extensions which is setting an environment variable and until recently (before VS 16.2 or 16.2.1) this environment variable was availabe in all devenv child processes. It seems that our package has started loading after the processes are created, the processes hierarchy was changed or something else happened which changed this behavior and breaked the functionality which depends on it. Is it possible to set environment variable in VS package in such a way that it will be available in all or some of the VS child processes and more specifically in the vstest.console process?
Alexander Gayko
@AdmiralSnyder
@MarkusAmshove you can add custom adornments manually into the text editor. i did this in my extension https://marketplace.visualstudio.com/items?itemName=AlexanderGayko.VarAdorner (there's a screenshot) it's up to you what data you put there. I don't know if there's an api to extend the codelens details directly, though (but i have a feeling of having read something in that direction somewhere… might be worth further googling for it)
Ken Domino
@kaby76
I found an answer to a part of the problem I asked about above. Pointed out here in Stackoverflow, one can create classification types at runtime using MEF CreateClassificationType(). This works great and removes a lot of the inflexible, static, redundant code. Now if I only can find the API hook to create an ITaggerProvider so I can set the file extension of a source file, like ".c;.cpp", I'll be able to write a VS extension that could support any programming language using Antlr grammars and some extra tables.
Carlos Quintero
@carlos-quintero
Does anybody know why the setting for Per-Monitor Awareness (PMA) in the Options window of VS 2019 remains disabled on virtual machines of VMWare or Parallels for macOS despite .NET 4.8 is installed and Windows 10 is April 2018 Update or higher? Has anyone been able to enable the checkbox? I have tried different settings in the VMs to no avail
Matthijs ter Woord
@mterwoord
vs is not detecting high-dpi?
Sergey-Vlasov
@Sergey-Vlasov
@carlos-quintero "Optimize rendering for screens with different pixel densities" is enabled in my VMware Workstation 15.1.0, Windows 10 v1903.
Cameron
@cameron314
@kaby76 I'm not sure I understand what you're trying to accomplish. You can create an ITaggerProvider for all content types (e.g. "code" or even "text") and just not return tags from it unless desired; is this enough for your use case?
Ken Domino
@kaby76
@cameron314 I'm creating a tagger for any language with information defined at runtime. I haven't tried removing the EXPORT FileExtensionToContentTypeDefinition field on the provider--I didn't know if it's required, but it seems plausible that it may not. I already make use of ITextBuffer.Properties for a file name, so I can perform the language-dependent tagging once I know that. I'll give this a try. Ty. -Ken
Cameron
@cameron314
@kaby76 The FileExtensionToContentTypeDefinition has nothing to do with the ITaggerProvider. It's used to create a mapping between your custom content type and a file extension. Your ITaggerProvider is currently registered exclusively to this custom content type, but it doesn't have to be. The fact that the content type/file-extension exports are declared within the ITaggerProvider implementation is pure coincidence :-)
Carlos Quintero
@carlos-quintero
@Sergey-Vlasov The problem must be macOS then . It happens with VMWare Fusion and Parallels
ArZei
@ArZei
Has there been a recent change in XAMLeditor Intellisense in version 16.2? We're having issues where on fresh WPF project creation the XAML editor will not recognize the MainWindow type resulting in blue squiggly and error in error list, until a build is performed after which everything is fine.
ArZei
@ArZei
We're a third party language extender and we are seeing this change in behavior in our WPF projects, but not in C#.
ArZei
@ArZei
Looks like someone has reported the same issue, in VB