Skip to content

Latest commit

 

History

History
111 lines (83 loc) · 6.34 KB

LearningJourney.md

File metadata and controls

111 lines (83 loc) · 6.34 KB

Visual Studio Extensions

This is my first attempt at a Visual Studio Extension.

Let the fun begin :)

Fantastic resource:

Google: mads kristensen extensions

Visual Studio Extensibility Cookbook

Visual Studio Extensions Marketplace

Marketplace

Tools

  • Extensibility Essentials 2022
  • Known Monikers Explorer 2022
  • Code Analysis With Roslyn's Syntax Trees
    • VS Syntax Visualizer:

      If you've already installed the .NET Compiler Platform SDK for your VS, use the following path to access this window: View -> Other Windows -> Syntax Visualizer.

    • VS DGML editor

      To install it, open the Visual Studio Installer. Locate the required VS installation instance, and click More -> Modify. Then switch to the following tab: Individual Component -> Code tools -> DGML editor.

Github

Github Actions - Build Pipeline

Various resources:


Troubleshoot

VS Template build issue

After creating a new VS solution via template Code Refactor (.NET Standard), it could not build.

Fix it by navigating to C:\Users\{YourUser}\.nuget\packages\microsoft.vssdk.buildtools and replaced the latest verion number found there. In my case: 15.1.192 => 17.1.4058.

Open the solution folder and replaced all 15.1.192 occurrences with 17.1.4058.

Error:

Build started...
1>------ Build started: Project: Moq.QuickMock, Configuration: Debug Any CPU ------
1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
1>Moq.QuickMock -> C:\Ru\Moq.QuickMock\Moq.QuickMock\Moq.QuickMock\bin\Debug\netstandard2.0\Moq.QuickMock.dll
2>------ Build started: Project: Moq.QuickMock.Vsix, Configuration: Debug Any CPU ------
2>C:\Users\BlahBlah\.nuget\packages\microsoft.vssdk.buildtools\15.1.192\tools\VSSDK\Microsoft.VsSDK.targets(84,5): error MSB4062: The "CompareBuildTaskVersion" task could not be loaded from the assembly C:\Users\BlahBlah\.nuget\packages\microsoft.vssdk.buildtools\15.1.192\tools\VSSDK\Microsoft.VisualStudio.Sdk.BuildTasks.15.0.dll. Could not load file or assembly 'file:///C:\Users\BlahBlah\.nuget\packages\microsoft.vssdk.buildtools\15.1.192\tools\VSSDK\Microsoft.VisualStudio.Sdk.BuildTasks.15.0.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
2>Done building project "Moq.QuickMock.Vsix.csproj" -- FAILED.
CodeRush canceled the build because project Moq.QuickMock\Moq.QuickMock.Vsix\Moq.QuickMock.Vsix.csproj failed to build. You can disable this behavior in the CodeRush options on the IDE\Build options page.
Build has been canceled.

Make extension a VS2022 one

update source.extension.vsixmanifest:

  ...
  <Installation>
    <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
      <ProductArchitecture>amd64</ProductArchitecture>
    </InstallationTarget>
  </Installation>
  ...

VS Extension debugger stopped working (does not hit breakpoints)

Found very good help from Microsoft's Troubleshoot Breakpoints in the Visual Studio Debugger.

Go to the Modules window (Debug > Windows > Modules) and check whether your module is loaded.

  • In the searchbox, I typed moq., and I saw that Symbol Status indicated: file not found.
  • Then Right-Clicked on my file and choose Open File Location.
  • Then dig around in there, and deleted my whole folder eg: C:\Users\{YourUser}\AppData\Local\Microsoft\VisualStudio\17.0_ad6c95ffRoslyn
  • It seemed like a new VS Instance, with the correct extensions and now it knows how to load the symbols again.

More options here on github to solve the issue a different way. I left my solution on that thread too.

Investigation tools:

Video to Gif conversion

cloudconvert