Giter VIP home page Giter VIP logo

Comments (9)

maxruben avatar maxruben commented on July 1, 2024

Change the source.extension.vsixmanifest file to this and it will install in visual studio professional 2019:

<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
  <Metadata>
    <Identity Id="8F12C6F5-BE35-4DDD-B452-44811F0A3A4D" Version="1.0" Language="en-US" Publisher="Sample" />
    <DisplayName>CppCustomVisualizer Debugger Sample</DisplayName>
    <Description xml:space="preserve">CppCustomVisualizer Debugger Sample</Description>
  </Metadata>
  <Installation InstalledByMsi="false">
    <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[14.0, 17.0)" />
  </Installation>
  <Prerequisites>
    <Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,)" DisplayName="Visual Studio core editor" />
  </Prerequisites>
  <Assets>
    <Asset Type="DebuggerEngineExtension" Path="CppCustomVisualizer.vsdconfig" d:Source="File" />
    <Asset Type="NativeVisualizer" Path="CppCustomVisualizer.natvis"  />
  </Assets>
</PackageManifest>

/Ruben

Edit; It seems like formatting of the xml code isn't preserved properly in the editor.

from concordextensibilitysamples.

pps83 avatar pps83 commented on July 1, 2024

use 3 backticks to paste as-is

from concordextensibilitysamples.

gregg-miskelly avatar gregg-miskelly commented on July 1, 2024

Also, there seem to be x64 versions, but .vsix doesn't build with x64 version.

The x86 solution configuration will build the custom visualizer project for both x86 and x64 and include both in the VSIX. See step 2 from here.

from concordextensibilitysamples.

pps83 avatar pps83 commented on July 1, 2024

Also, there seem to be x64 versions, but .vsix doesn't build with x64 version.

The x86 solution configuration will build the custom visualizer project for both x86 and x64 and include both in the VSIX. See step 2 from here.

Thanks, I've figured it out after I posted it here (and how to make it run on vs2019)

from concordextensibilitysamples.

pps83 avatar pps83 commented on July 1, 2024

I wanted to write my own visualizer and the only place to start is CppCustomVisualizer, I wasn't able to find anything else. In hopes to make it better I'll share my experience/feedback:

  • I recall with old visualizers (in vs2005-2008 era) it was easier to debug them, as I was able to build and run it in the same project without installing vs extension. Now it's unnecessarily complicated as I had to uninstall/install (and quit VS each time) and I wasn't even able to debug visualizer itself.
  • I started with the sample and had to search/replace to rename it. It's not clear where and which GUIDs I'd need to change to make it different (according to VS) from CppCustomVisualizer. At first VS refused to install it (as I didn't update GUIDs), and then when I updated them, it simply didn't work (perhaps I changed too many GUIDs). So, I simply settled on using the same code as CppCustomVisualizer itself. Sample should list what guilds need to be changed and where.

from concordextensibilitysamples.

maxruben avatar maxruben commented on July 1, 2024

The good thing about the CppCustomVisualizer sample is that it actually starts a new Visual Studio instance with the TargetApp and the visualizer dll installed via the .vsix (startup) project when running a debug session on the CppCustomVisualizer project. When starting the debugger for the TargetApp, you can set breakpoints in the dll code in the other Visual Studio instance to see whats happening. No need to keep installing and uninstalling the .vsix file. Just close down the debugging for the TargetApp and the Visualizer dll will be installed from fresh in the next debugging session. Very nice.

I would like to have some more insight in how you would go about to do custom visualizers for more than one type/class in the same dll.

/Ruben

from concordextensibilitysamples.

gregg-miskelly avatar gregg-miskelly commented on July 1, 2024

@pps83 as maxruben mentioned, you shouldn't need to install/uninstall a .vsix for normal development-time debugging. The VSIX project's build will take care of 'installing' the vsix into the 'experimental instance' of VS. In case you didn't see them, there are instructions here.

from concordextensibilitysamples.

pps83 avatar pps83 commented on July 1, 2024

@gregg-miskelly I tried to follow Running the Sample in Visual Studio but it doesn't work. When I hit F5, I get a new vs2019 started but it doesn't load TargetApp.sln and offers me to open a project. If I open TargetApp.sln manually and try to debug, I don't get visualizers working for FILETIME.

Also, as @maxruben mentioned, it's not clear how to make visualizers that work for multiple types. That should be explained/shown in the example.

from concordextensibilitysamples.

gregg-miskelly avatar gregg-miskelly commented on July 1, 2024

@pps83 For the issue of F5'ing not working, can you open a new issue? Please include:

  • What version of VS you are using
  • Did you clone the repo to a path with a space?
  • A screen capture of your Visual Studio with solution explorer up, and the 'Debugging' property page of the .vsix project showing (see example below)

For the second question (multiple types): There are probably many different answers depending on how separate you want your implementations to be, but in the most simple case, just add the additional type to your natvis. You should be able to either reuse the same VisualizerId, or declare a new one. If you decide to declare a new one, you could either declare multiple classes (one for each VisualizerId) or you could have one class that handles them all. In the later case, your .vsdconfigxml would look like this:

<Implements>
        <InterfaceGroup>
          <Filter>
             <!-- Example of supporting three different visualizers. -->
            <VisualizerId RequiredValue="D3C901B3-8005-435E-803D-DF43E6C3ED29"/>
            <VisualizerId RequiredValue="748F6A19-A624-4026-A39C-8019532B586E"/>
            <VisualizerId RequiredValue="D6DFE1A0-4A83-4BAC-B3BB-0FB8BF9149DA"/>
          </Filter>
          <Interface Name="IDkmCustomVisualizer"/>
        </InterfaceGroup>
      </Implements>

Example screen capture:
vsix-launch

from concordextensibilitysamples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.