Fail to migrate the VS 2019 project to VS 202

Ruhong Cai 1 Reputation point
2022-03-07T22:43:30.243+00:00

Hi,

When we try to migrate the VS 2019 plugin project to VS 2022, we need to change the Target .NET framework 4.5 to 4.7.2 to solve tons of compiler errors, also
add the new reference "Microsoft.VisualStudio.Interop" and make sure all the reference Path has pointed to the "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\PublicAssemblies\"

After build successfully , run our plugin project, click "Extension" => "Our plugin name" => "Our configuration Dialog", keep
getting the follow error

CreateInstance failed for package [CollaboratorPackage]Source: 'mscorlib' Description: Could not load file or assembly 'Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type) at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase) at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence

Our plugin project calls Microsoft.VisualStudio.Shell.14.0.dll which does not exist in VS 2022, try to remove it and add Microsoft.VisualStudio.Shell.15.0 reference but got lots of compiler errors.

Please help to advise which new lib we could use in Vs 2022 which replace Microsoft.VisualStudio.Shell.14.0.dll in VS 2019.

Many thanks!

Ruhong

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,705 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,390 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 26,646 Reputation points Microsoft Vendor
    2022-03-08T08:16:37.42+00:00

    Hi @Ruhong Cai ,

    Welcome to Microsoft Q&A!

    It seems that your project has a dependency on the specific version Microsoft.VisualStudio.Shell.14.0, Version=14.0.0.0.
    But in Visual Studio 2022, you can install the Microsoft.VisualStudio.Shell.14.0, Version 14.0.22823-RC or higher.

    If you want to successfully migrate your project from VS2019 to VS2022, you can update the assembly to the supported version to run the plugin project.

    Sincerely,
    Anna
    *
    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.