Skip to content
This repository was archived by the owner on Sep 22, 2022. It is now read-only.

Comments

Add Visual Studio 2022 Support#20

Open
lesterlo wants to merge 3 commits intopoma:masterfrom
lesterlo:Add_VisualStudio2022_support
Open

Add Visual Studio 2022 Support#20
lesterlo wants to merge 3 commits intopoma:masterfrom
lesterlo:Add_VisualStudio2022_support

Conversation

@lesterlo
Copy link

@lesterlo lesterlo commented Jun 6, 2022

Hello, I have added Visual Studio 2022 Support to this extension. I have tested it on my own computer, it works and able to hide the menu bar on VS2022.

Modification

I have modified the following items:

  1. Change build target from .NET Framework 4.6 to 4.7.2
  2. Upgrade old packages to the latest stable version.
  3. Update VisualStudio internal package HintPath
  4. Change the version range of Install Targets and prerequisites in VSIX manifest.

Reason

Since visual studio 2022 is a 64-bit program. I updated some Assemblies' hintPath from "C:\Program Files (x86)" to "C:\Program Files"

Since the vs2022 Shell.ViewManager, shell.UI.Internal.resources, shell.UI.Internal, Utilities required at least .NET Framework 4.7.2, we have updated the .NET Framework version.

#example
"Microsoft.VisualStudio.Shell.ViewManager" could not be resolved because it has an indirect dependency on the assembly "System.IO.Pipelines, Version=6.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" which was built against the ".NETFramework,Version=v4.6.1" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.6".	MinimalisticView			

Screenshot

MinimalisticView - Microsoft Visual Studio 2022-06-06 11-58-25

lesterlo added 2 commits June 6, 2022 10:36
Upgrade to .Net FrameWork 4.7.2.
Upgrade old package.
Upgrade VisualStudio internal package HintPath

Since visual studio 2022 is and 64-bit program.
The hintPath from "C:\Program Files (x86)\" to "C:\Program Files\"
Change vsix manifest, Install Targets from [15.0, 17.0) to version [15.0, 18.0) on x86 and amd64 architectures
Change vsix manifest, prerequisites, Visual Studio core editor from [15.0, 17.0) to [15.0, 18.0)
@poma
Copy link
Owner

poma commented Jun 8, 2022

Was it tested on previous VS versions and old .NET framework? Want to make sure that nothing will break for existing users before merging

@lesterlo
Copy link
Author

lesterlo commented Jun 9, 2022

I have tested on visual Studio 2022 with .NET Framework 4.7.2. It can hide the menu bar.
For Visual Studio 2019 with .NET Framework 4.7.2, it also can hide the menu bar, but some of the times, the visual studio will have a runtime error. The runtime error is Could not load file or assembly; Microsoft.VisualStudio.Shell.15.0

Since I don't have an older visual studio such as 2017, I cannot test on the older version.

I think the reason for the runtime error is that visual studio 2019 is targeted on the x86 platform and 2022 is targeted on x64. I have only included the x64 visual studio .dll files.

According to the Extension Migration Guide
, we should 'use shared projects for multi-targeting'. I am reviewing this guide and see whether I can improve the building process of this extension

I am still finding a way to support both visual studio 2019 and 2022.

  • Visual Studio 2022 Successful running screen

mini_view_1

  • Visual Studio 2019 Successful running screen

mini_view_2

  • Visual Studio 2019 Error Log

mini_view_3

Reference

Extension Migration Guide

@timofey-nekhaenko-stenn

@lesterlo Could you attach a built .vsix into the project or somewhere else. I have problems to build it manually.

@lesterlo
Copy link
Author

@timofey-nekhaenko-stenn

Please refer to this issue. You can find the .vsix package over there

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants