Compiling Visual Studio extension - problem with Microsoft.VisualStudio namespace

Viewed 23

I'm learnig how create add-ons for VisualStudio.

First I downloaded this extension: Microsoft Dynamics AX 2012 X++ Editor Extensions (finally I needs a extension to the X ++ editor, hence the choice)

The extension works fine - I'm trying to edit it.

The project loads fine (I'm using Visual 2022), but when I try to compile it crashes into the Microsoft namespace. For example:

  • The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
  • The type or namespace name 'IAdornmentLayer' could not be found (are you missing a using directive or an assembly reference?)
  • The type or namespace name 'IWpfTextView' could not be found (are you missing a using directive or an assembly reference?)

I tried to solve the problem by adding the library Microsoft.VisualStudio.QualityTools.UnitTestFramework to the project, but then I got next errors. For example - I have in project:

using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Text.Editor;

This generate errors:

The type or namespace name 'Text' does not exist in the namespace 'Microsoft.VisualStudio' (are you missing an assembly reference?)

For test I change target framework from .NET framework 4 to .NET framework 4.5 (and change node SupportedFrameworkRuntimeEdition in \obj\Debug\extension.vsixmanifest file) - in this configuration compiling is done correctly (but extension not works in X++ editor - so this not resolve my problem).

I'm using

  • Microsoft Visual Studio Community 2022 (64-bit) - Version 17.3.4
  • Windows Server 2012 R2

How can I solve this problem?

Regards, Tomasz

1 Answers

I created Virtual Machine with Windows 7, installed Visual Studio Professional 2010 SP1 + SDK - on this setup everything works fine.

Related