Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio 2022 support #333

Open
GSonofNun opened this issue Oct 20, 2021 · 17 comments
Open

Visual Studio 2022 support #333

GSonofNun opened this issue Oct 20, 2021 · 17 comments
Assignees

Comments

@GSonofNun
Copy link

Simple request for support for Visual Studio 2022.

Installation fails:
image

Log:

10/20/2021 11:15:14 AM - Microsoft VSIX Installer
10/20/2021 11:15:14 AM - -------------------------------------------
10/20/2021 11:15:14 AM - vsixinstaller.exe version:
10/20/2021 11:15:14 AM - 17.0.5226-preview5
10/20/2021 11:15:14 AM - -------------------------------------------
10/20/2021 11:15:14 AM - Command line parameters:
10/20/2021 11:15:14 AM - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,C:\Users\joshg\AppData\Local\Temp\MicrosoftEdgeDownloads\dadad0a7-01a4-405b-9ea5-caf4dc977732\GoogleTestAdapter-0.18.0.vsix
10/20/2021 11:15:14 AM - -------------------------------------------
10/20/2021 11:15:14 AM - Microsoft VSIX Installer
10/20/2021 11:15:14 AM - -------------------------------------------
10/20/2021 11:15:15 AM - Skipping product Microsoft.VisualStudio.Product.BuildTools (3bb528d2) since it does not support extensions
10/20/2021 11:15:15 AM - Initializing Install...
10/20/2021 11:15:15 AM - Extension Details...
10/20/2021 11:15:15 AM - 	Identifier         : GoogleTestAdapterVSIX.e57b9720-dfde-4baa-bcb5-0f75772012b4
10/20/2021 11:15:15 AM - 	Name               : Google Test Adapter
10/20/2021 11:15:15 AM - 	Author             : Christian Soltenborn
10/20/2021 11:15:15 AM - 	Version            : 0.18.0.1432
10/20/2021 11:15:15 AM - 	Description        : Adds support for the C++ unit testing framework Google Tests.
10/20/2021 11:15:15 AM - 	Locale             : en-US
10/20/2021 11:15:15 AM - 	MoreInfoURL        : https://github.com/csoltenborn/GoogleTestAdapter
10/20/2021 11:15:15 AM - 	InstalledByMSI     : False
10/20/2021 11:15:15 AM - 	SupportedFrameworkVersionRange : [4.5,4.7]
10/20/2021 11:15:15 AM - 
10/20/2021 11:15:15 AM - 	SignatureState     : Unsigned
10/20/2021 11:15:15 AM - 	Supported Products : 
10/20/2021 11:15:15 AM - 		Microsoft.VisualStudio.Pro
10/20/2021 11:15:15 AM - 			Version : [12.0,17.0)
10/20/2021 11:15:15 AM - 			ProductArchitecture : x86
10/20/2021 11:15:15 AM - 		Microsoft.VisualStudio.Enterprise
10/20/2021 11:15:15 AM - 			Version : [12.0,17.0)
10/20/2021 11:15:15 AM - 			ProductArchitecture : x86
10/20/2021 11:15:15 AM - 		Microsoft.VisualStudio.Ultimate
10/20/2021 11:15:15 AM - 			Version : [12.0,17.0)
10/20/2021 11:15:15 AM - 			ProductArchitecture : x86
10/20/2021 11:15:15 AM - 		Microsoft.VisualStudio.Community
10/20/2021 11:15:15 AM - 			Version : [12.0,17.0)
10/20/2021 11:15:15 AM - 			ProductArchitecture : x86
10/20/2021 11:15:15 AM - 
10/20/2021 11:15:15 AM - 	References         : 
10/20/2021 11:15:15 AM - 	Prerequisites      : 
10/20/2021 11:15:15 AM - 		-------------------------------------------------------
10/20/2021 11:15:15 AM - 		Identifier   : Microsoft.VisualStudio.Component.CoreEditor
10/20/2021 11:15:15 AM - 		Name         : Visual Studio core editor
10/20/2021 11:15:15 AM - 		Version      : [15.0,)
10/20/2021 11:15:15 AM - 
10/20/2021 11:15:15 AM - 		-------------------------------------------------------
10/20/2021 11:15:15 AM - 		Identifier   : Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core
10/20/2021 11:15:15 AM - 		Name         : Visual Studio C++ core features
10/20/2021 11:15:15 AM - 		Version      : [15.0,)
10/20/2021 11:15:15 AM - 
10/20/2021 11:15:15 AM - Signature Details...
10/20/2021 11:15:15 AM - 	Extension is not signed.
10/20/2021 11:15:15 AM - 
10/20/2021 11:15:15 AM - Searching for applicable products...
10/20/2021 11:15:15 AM - Found installed product - Global Location
10/20/2021 11:15:15 AM - Found installed product - Visual Studio Enterprise 2022 Preview
10/20/2021 11:15:15 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
   at VSIXInstaller.ExtensionService.GetInstallableDataImpl(IInstallableExtension extension, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   at VSIXInstaller.ExtensionService.GetInstallableData(String vsixPath, String extensionPackParentName, Boolean isRepairSupported, IStateData stateData, IEnumerable`1& skuData)
   at VSIXInstaller.ExtensionPackService.IsExtensionPack(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.ExtensionPackService.ExpandExtensionPackToInstall(IStateData stateData, Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
@csoltenborn
Copy link
Owner

Thanks for the request! I will look into this in the next two or three weeks (in fact, MS has already contacted me by me about this). However, I fear that this would mean to support two versions of the adapter ("pre-20222" and "2022 and later"), and I'm not sure whether I'm willing to go that way. I'm not completely sure from the technical point of view, though - I'll let you know.

@acangialosi
Copy link

@csoltenborn I noticed you are starting to update your VS extension. If you have any issues upgrading the extension please feel free to reach out and we can loop in folks from the engineering team to help out. Do you have an idea of when you expect to publish your new version?

@csoltenborn
Copy link
Owner

@acangialosi In fact it's quite the opposite, I fear (see my comment above yours ;-) ). As far as I have understood, there's no way to deliver a single extension which supports not only the new VS 2021, but also VS down to VS2015. Thus, I'd had to split up my extension, and I had to provide two different versions via the VS marketplace. Can you confirm this?

@acangialosi
Copy link

acangialosi commented Nov 4, 2021 via email

@csoltenborn
Copy link
Owner

@acangialosi It is less of a problem to have two separate pages on the marketplace (I just mentioned this to make clear what I mean), but to take care of "two version" of GTA. At the moment, I think that I'm not going to go that way. This is mainly because at my current job, I'm not using GTA any more, which is why I have spent less time on this project in the last year or so. Plus, there's MS's fork of GTA (TAfGT), which I assume is already ported to VS2021 (or will be ported soon) - TAfGT is based on an older version of GTA (0.10 or 0.11 if I remember correctly), so users will loose some features, but the most important ones will still be available (plus, my code will continue to live :-) ). In fact, at the moment users have to opt out of using TAfGT during installation of VS and then manually install GTA, and I don't think that many users are doing that anyways.

@mike10004
Copy link

In fact, at the moment users have to opt out of using TAfGT during installation of VS and then manually install GTA, and I don't think that many users are doing that anyways.

Opting out and manually installing GTA is what I do, because TAfGT interprets skipped tests as crashes, which is a dealbreaker for me.

For other users wondering about a temporary workaround, what I did was download the v0.18.0 .vsix release of the extension, unzip it, and edit extension.vsixmanifest to change

<Installation InstalledByMsi="false">
  <InstallationTarget Version="[12.0,17.0)" Id="Microsoft.VisualStudio.Pro" />
  <InstallationTarget Version="[12.0,17.0)" Id="Microsoft.VisualStudio.Enterprise" />
  <InstallationTarget Version="[12.0,17.0)" Id="Microsoft.VisualStudio.Ultimate" />
  <InstallationTarget Version="[12.0,17.0)" Id="Microsoft.VisualStudio.Community" />
</Installation>

so that it looks like this:

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

Then zip up the directory and change the extension to .vsix and install by double-clicking it in Windows Explorer.

(I get a message dialog about the GoogleTestExtensionOptionsPage not loading correctly, but I have gotten that in the past, and I always assumed it was somehow related to replacing TAfGT with GTA.)

@bdalessandro
Copy link

@mike10004 That lets me install the extension, but I still can't actually run any of the tests (the output log shows that it promptly throws an exception when I try). Were you able to run tests?

TAfGT likewise does not work for me since it reports GTEST_SKIP as an error rather than a skipped test like you describe.

@mike10004
Copy link

That lets me install the extension, but I still can't actually run any of the tests (the output log shows that it promptly throws an exception when I try). Were you able to run tests?

@bdalessandro I was able to run the tests successfully after rebuilding the solution.

@csoltenborn
Copy link
Owner

Wow - I'm kind of honored by you posting a workaround to still use my adapter ;-)

In fact I'm a bit surprised that this works (and I'm wondering whether it will continue working with the final version of VS), since the migration guide states that "Extensions with running code must be compiled specifically for Visual Studio 2022."...

@echalone
Copy link

I can confirm that Google Test Adapter 0.18.0 still works with Visual Studio 2022. You can't install it for that Visual Studio of course, but if you just unpack the vsix (it's a zip after all) into some random directory and use that directory as a test adapter when calling vstest.console.exe of VS 2022 then there's no problem with it. :)

@bdalessandro
Copy link

@mike10004 Thanks, yes, that worked!... after fully cleaning & rebuilding, I can run the tests using your workaround.

@csoltenborn Your adapter has features that Microsoft's fork does not, like Skipped tests! I was nearly ready to try and rebuild your extension myself, even though i have no C# or extension experience.

@echalone
Copy link

echalone commented Nov 23, 2021

The main problem seems to be, that the Microsoft.VisualStudio.Shell.12.0.dll cannot be found in Visual Studio 2022 (according to the ActivityLog), as it's no longer shipped in the public (\Common7\IDE\PublicAssemblies) or private (\Common7\IDE\PrivateAssemblies) assemblies of that product. Which is why that GoogleTestExtensionOptionsPage error is displayed. The only one being shipped with it is Microsoft.VisualStudio.Shell.15.0, Version=17.0.0.0 (in the public assemblies).
Funny enough, if you copy the dll into the private assembly folder of your VS 2022 installation, it will break with error "method EnvDTE.Solution EnvDTE._DTE.get_Solution not found", which is probably a method no longer supported with VS 2022.

I've tried to update the libraries to their Version 17. but am then getting various errors (about 22 of them) during building. Mostly "Interop type 'RegistrationAttribute' cannot be embedded. Use the applicable interface instead." and similar. I've cloned the repo and published my changes to my own repo in the branches User/echalone/VS2022Update_Community (for building with VS 2022 Community Edition) and User/echalone/VS2022Update_Enterprise (for building with VS 2022 Enterprise Edition). Maybe somebody can go from there and try to get it to work? I'm a bit lost at that point ^^

@slymz
Copy link

slymz commented Mar 23, 2022

In fact, at the moment users have to opt out of using TAfGT during installation
of VS and then manually install GTA, and I don't think that many users
are doing that anyways

We are doing that. The entire company!

TAfGT is broken on so many levels. Trivial requests on developercommunity are ignored without action (Example1, example2, example3, ...). And the issue list in GitHub lately seems to be a goner - see https://github.com/microsoft/TestAdapterForGoogleTest, no "Issues", problem solved! :/

Tried VS 2022 latest version as of today with TAfGT. Broken. Most tests are not discoverable, without any helpful diagnostics as to what is going on. GTA with VS 2019, same exact solution and projects. Works perfectly.

@alex-nl
Copy link

alex-nl commented Jun 7, 2022

In fact, at the moment users have to opt out of using TAfGT during installation of VS and then manually install GTA, and I don't think that many users are doing that anyways.

Opting out and manually installing GTA is what I do, because TAfGT interprets skipped tests as crashes, which is a dealbreaker for me.

For other users wondering about a temporary workaround, what I did was download the v0.18.0 .vsix release of the extension, unzip it, and edit extension.vsixmanifest to change

<Installation InstalledByMsi="false">
  <InstallationTarget Version="[12.0,17.0)" Id="Microsoft.VisualStudio.Pro" />
  <InstallationTarget Version="[12.0,17.0)" Id="Microsoft.VisualStudio.Enterprise" />
  <InstallationTarget Version="[12.0,17.0)" Id="Microsoft.VisualStudio.Ultimate" />
  <InstallationTarget Version="[12.0,17.0)" Id="Microsoft.VisualStudio.Community" />
</Installation>

so that it looks like this:

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

Then zip up the directory and change the extension to .vsix and install by double-clicking it in Windows Explorer.

(I get a message dialog about the GoogleTestExtensionOptionsPage not loading correctly, but I have gotten that in the past, and I always assumed it was somehow related to replacing TAfGT with GTA.)

Thanks for this, I was able to manually install in VS2022 as well.

Has anyone noticed any genuine issues with the Microsoft.VisualStudio.Shell.12.0.dll error, or is it just visual noise?

@bdalessandro
Copy link

Has anyone noticed any genuine issues with the Microsoft.VisualStudio.Shell.12.0.dll error, or is it just visual noise?

The only issue I've noticed is that I can't debug into a unit test. If I set a breakpoint & debug the test, the test will simply fully run & never stop at the breakpoint.

@alex-nl
Copy link

alex-nl commented Jun 14, 2022

The only issue I've noticed is that I can't debug into a unit test. If I set a breakpoint & debug the test, the test will simply fully run & never stop at the breakpoint.

I see in the test logs it says
[13:42:03.886 ERROR] Debugging is only possible if GoogleTestAdapter has been installed into Visual Studio - NuGet installation does not support this (and other features such as Visual Studio Options, toolbar, and solution settings).

So I suppose this has to do with the manual installation.

@stefan-muc
Copy link

For other users wondering about a temporary workaround, what I did was download the v0.18.0 .vsix release of the extension, unzip it, and edit extension.vsixmanifest to change

[...]

Then zip up the directory and change the extension to .vsix and install by double-clicking it in Windows Explorer.
(I get a message dialog about the GoogleTestExtensionOptionsPage not loading correctly, but I have gotten that in the past, and I always assumed it was somehow related to replacing TAfGT with GTA.)

Thanks for this, I was able to manually install in VS2022 as well.

Sadly I didn't get this workaround to work anymore. I'm using Visual Studio 2022 Version 17.6.4 and after installing and starting Visual Studio I get this error message:

image

Test Explorer shows this line:
image

Is there anything that I can do about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants