My Progress Getting Visual Studio Working In WINE

ABSTRACT (TL;DR):

I am able to install Visual Studio 2019 Community, Professional, and Enterprise, but I am stuck at an error: Couldn’t Install Microsoft.DiagnosticsHub.Collection.StopService.Install. Having tried to resolve it myself without success, I was looking for other suggestions. I have detailed my installation steps, the solutions I have tried, my system specs, and give a detailed overview of my progress.

NOTE: The forum software had a stroke because I had too many links so I had to reverse https to sptth to get it to accept my post.

OVERVIEW:

The Visual Studio IDE is the last piece of the puzzle for me to drop Windows completely from my system. I do a lot of contract work in C# and my clients usually send me an archive of their solution so I can work on it.

It is easier to use Visual Studio because that is what they are using as opposed to me trying to cobble back and forth with Visual Studio Code or some other IDE they are not use.

I started down this path when I saw a post from Cedric <cedric.dewijs at eclipso.eu> here: https://www.winehq.org/pipermail/wine-bugs/2021-September/561971.html. I emailed Cedric about his progress, but he never responded.

I was able to jump off from his post and install Visual Studio 2019 BuildTools and Visual Studio 2019 Community, Professional, and Enterprise. However, when you launch any of the editions I get this error that I’m not able to resolve:

Couldn’t Install Microsoft.DiagnosticsHub.Collection.StopService.Install

You will find my installation steps as well as a list of solutions I have tried below.

DISTRO INFORMATION:

                 ./o.                  mark@nx1701i
               ./sssso-                ------------
             `:osssssss+-              OS: EndeavourOS Linux x86_64
           `:+sssssssssso/.            Host: Inspiron 16 7610
         `-/ossssssssssssso/.          Kernel: 5.19.7-arch1-1
       `-/+sssssssssssssssso+:`        Uptime: 19 hours, 4 mins
     `-:/+sssssssssssssssssso+/.       Packages: 1668 (pacman), 5 (snap)
   `.://osssssssssssssssssssso++-      Shell: bash 5.1.16
  .://+ssssssssssssssssssssssso++:     Resolution: 3072x1920
.:///ossssssssssssssssssssssssso++:    DE: Plasma 5.25.5

:////ssssssssssssssssssssssssssso+++. WM: KWin -////+ssssssssssssssssssssssssssso+++± WM Theme: Ember
..-+oosssssssssssssssssssssssso+++++/ Theme: [Plasma], Breeze [GTK3]
./++++++++++++++++++++++++++++++/:. Icons: [Plasma], breeze [GTK2/3]
`:::::::::::::::::::::::::------`` Terminal: gnome-terminal
CPU: 11th Gen Intel i7-11800H (16) @
GPU: NVIDIA GeForce RTX 3050 Mobile
GPU: Intel TigerLake-H GT1 [UHD]
Memory: 9947MiB / 64054MiB

WINE VERSION:

wine-7.16 (Staging)

MY INSTALLATION STEPS:

  1. rm -rf ~/.cache/wine*

  2. Create a home folder called VS2019

  3. CD into VS2019

  4. WINEPREFIX=“/home/mark/VS2019/” wineboot

NOTE: WINE will ask to install wine-mono which is fine

  1. WINEPREFIX=“/home/mark/VS2019/” winecfg

NOTE: I set the version to Windows 7 and adjust the DPI (I’m on a 3k screen)

  1. WINEPREFIX=“/home/mark/VS2019/” winetricks -q arial d3dcompiler_47

  2. WINEPREFIX=“/home/mark/VS2019/” winetricks dotnet472

NOTE: If I use -q the install will hang during install so I leave it out. Also, this is the longest part of the installation. It installs 4.6 through 4.71 with many ‘reboots’. It should complete without any errors.

  1. WINEPREFIX=“/home/mark/VS2019/” winetricks vstools2019

NOTE: You will now see the Visual Studio 2019 GUI installer. Take the defaults and click Install

!NOTE! From here, you can choose one of two options:

Option 1:

The installer -as far as I can tell- is installed so steps 9 - 12 aren’t needed. You can enter WINEPREFIX=“/home/mark/VS2019/” winetricks vstools2019 again since BuildTools is now installed to bring the GUI installer up. Select the tab AVAILABLE and choose Visual Studio Community, Professional, or Enterprise to install.

I’ve done it both ways and couldn’t see any differences, so its up to you.

Option 2:

  1. wget https://aka.ms/vs/16/release/installer -O vs_installer.opc

  2. mkdir -p opc

  3. unzip -d opc vs_installer.opc

  4. WINEPREFIX=“/home/mark/VS2019/” wine opc/Contents/vs_installer.exe install --channelId VisualStudio.16.Release --channelUri “https://aka.ms/vs/16/release/channel” --productId Microsoft.VisualStudio.Product.Community

NOTE: Replace Microsoft.VisualStudio.Product.Community with Microsoft.VisualStudio.Product.Professional or Microsoft.VisualStudio.Product.Enterprise for the version you want to install. You can install all three, one after another if you want.

No matter which edition I install, I get: Couldn’t Install Microsoft.DiagnosticsHub.Collection.StopService.Install

SOLUTIONS TRIED:

  1. Comparing /home/mark/VS2019/drive_c/ProgramData/Microsoft/VisualStudio/Packages with my Windows 10/Visual Studio 2019 VM c:\ProgramData\Microsoft\VisualStudio\Packages I noticed that Microsoft.DiagnosticsHub.Collection.StopService.Install,version=16.1.28901.1 was missing from my WINE install. So, I copied Microsoft.DiagnosticsHub.Collection.StopService.Install,version=16.1.28901.1 over but it made no difference.

  2. I did a clean install of VS2019 using WINEARCH=win32 WINEPREFIX=“/home/mark/VS2019/” so it would be a 32bit install of Visual Studio 2019. I thought this might help the installer to see Microsoft.DiagnosticsHub.Collection.StopService.Install,version=16.1.28901.1 but same error.

  3. If you put sptth://aka.ms/vs/16/release/installer into your browser you get a file manifest and I checked to see if there were other versions I could try, but I didn’t see anything.

  4. With a clean install of VS2019 I followed MY INSTALLATION STEPS and then exited the installer. I also stopped all WINE tasks. I replaced /home/mark/VS2019/drive_c/Program Files (x86)/Microsoft Visual Studio/ with the one from my working VM. I then started the Visual Studio 2019 Installer again in WINE and launched the Community edition, but it failed with the same error.

  5. With a clean install of VS2019 I followed MY INSTALLATION STEPS and then exited the installer. I also stopped all WINE tasks. I replaced /home/mark/VS2019/drive_c/ProgramData/Microsoft/VisualStudio/Packages with the one from my working VM. I then started the Visual Studio 2019 Installer again in WINE and launched the Community edition, but it failed with the same error.

  6. I mixed and matched 4. and 5. but nothing made a difference.

  7. I tried MY INSTALLATION STEPS on Visual Studio 2022 by doing this: wget sptth://aka.ms/vs/17/release/installer -O vs_installer.opc and this: WINEPREFIX=“/home/mark/VS2019/” wine opc/Contents/vs_installer.exe install --channelId VisualStudio.17.Release --channelUri “sptth://aka.ms/vs/17/release/channel” --productId Microsoft.VisualStudio.Product.Community

However, I can’t even get the Visual Studio 2022 installer GUI to appear without an error.

  1. If I update the Visual Studio 2019 installer from the installer it errors out, same as if I install Visual Studio 2022 from the 2019 installer.

Any suggestions would be welcome, Thank You!

3 Likes

My goodness posting the log itself seems to be a herculean task for me.

There exists an official binary distribution from Microsoft in the AUR, also see the comments section there…

To install this, one simply needs to run:
yay -S visual-studio-code-bin

Why even start messing with wine?

Omg, I would rather run this one line command… :grin:

Visual Studio != Visual Studio Code

Visual Studio doesn’t have an official binary for Linux.

Topic:
Have you considered using https://www.jetbrains.com/rider/?

Nope.

I have one Windows application I haven’t been able to fully ditch … my answer has been to run Windows under qemu/virt-manager - maybe worth considering if you are a 99.9% pure linux :slight_smile:

1 Like