'Cannot Install Visual Studio Community Edition (IDE) and always run into dll not found exception

NOTE: I have asked the question on SuperUser as it is a relevant community, but I didn't get any answer there so I thought about asking here.

Please note I don't want to reinstall windows on my PC or reset it

So, I had visual studio 2019, 1 month ago working just fine. I wanted to install more packages so I ran the installer_shell.exe and it asked for an update. When I updated it, it again asked for an update and didn't seem to have updated and this process continued every time, Then I posted this issue on Microsoft Developer Community.

After that, I referred to many solutions: One of the solution was to do install cleanup and install the Vs_community.exe again which is mentioned here.

After applying it I can't even install the Vs_community.exe which also happened with the Original User who posted.

When i run the newly downloaded vs_community.exe the error in this log file is DllNotFoundException, Message = Unable to load DLL 'Microsoft.C2RSignatureReader.Native.dll'

Also, this dll is nowhere to be found in my laptop or my friend's laptop who has a working Visual Studio 2019 and Installer.

This is the log file that is generated:

Beginning of the log. Start Time: 11/13/2021 3:49:56 PM
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Commandline arguments = --env,_SFX_CAB_EXE_PACKAGE:C:\Users\Daniyal Shaikh\Downloads\vs_community__1177568830.1625520809.exe _SFX_CAB_EXE_ORIGINALWORKINGDIR:C:\Users\Daniyal Shaikh\Downloads
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Caught Exception: Type = DllNotFoundException, Message = Unable to load DLL 'Microsoft.C2RSignatureReader.Native.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E), StackTrace =    at C2RSignatureReader.Interop.C2RSignatureReaderNative.ParseArguments(String path, String[]& argumentsArray)
   at C2RSignatureReader.Interop.C2RSignatureReaderInterop.ParseArguments(String path, String[]& arguments)
   at Microsoft.VisualStudio.Setup.Bootstrapper.Program.Parse(String[] args, IServiceProvider serviceProvider, IC2RSignatureReaderInterop c2rSignatureReader, String entryAssemblyProcessName, String entryAssemblyProcessFullName)
   at Microsoft.VisualStudio.Setup.Bootstrapper.Program.Run(String[] args)
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: General Failure. Message:Unable to load DLL 'Microsoft.C2RSignatureReader.Native.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) Callstack:    at C2RSignatureReader.Interop.C2RSignatureReaderNative.ParseArguments(String path, String[]& argumentsArray)
   at C2RSignatureReader.Interop.C2RSignatureReaderInterop.ParseArguments(String path, String[]& arguments)
   at Microsoft.VisualStudio.Setup.Bootstrapper.Program.Parse(String[] args, IServiceProvider serviceProvider, IC2RSignatureReaderInterop c2rSignatureReader, String entryAssemblyProcessName, String entryAssemblyProcessFullName)
   at Microsoft.VisualStudio.Setup.Bootstrapper.Program.Run(String[] args) Inner Message: Internal Exception: 
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: Sending Watson Bucket with:
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P1  = vs_setup_bootstrapper
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P2  = 3.0.4492.23473
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P3  = 
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P4  = 
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P5  = 
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P6  = n/a
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P7  = 5002
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P8  = -2146233052
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P9  = 
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: P10 = 
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: Including dmp file
VisualStudio Bootstrapper:11/13/2021 3:49:57 PM: Watson: Including Log : C:\Users\Daniyal Shaikh\AppData\Local\Temp;\dd_bootstrapper_20211113154956.log

I have tried almost all the solutions that are mentioned in my dev_community report.

I dont want to list all of them here. If anyone is willing to help they can check on the above link where i posted the original issue.

One other solution i tried was to take the installer and visual studio folders from my friend. I copied and pasted all of the folders and files in my pc. They launch for a couple of seconds bu then are automatically closed. (both the installer and the IDE).

So to summarize

Solutions that i tried:

Updating Windows

Repair .NET FrameWork

Troubleshoot

Solutions i tried but failed:

Windows security update KB5001337

Find Microsoft.C2RSignatureReader.Native.dll file

Because of the above issue, I didn't proceed to Clean Boot as mentioned in the above link.

Please help me solve the problem and here are some possibilities that I wasn't able to perform.

Things I suspect that can solve my problem

Following may be the possible solutions but I can't apply them as I don't know how to

  1. Start the related microsoft services (i don't know what services are related to it).
  2. Give security priviliges to access dll if it exists. (i can't locate dll).
  3. Check if the machine.config has been changed in .net framework. (i don't know how to check if it is changed) but when i run the repair tool it didn't find any errors.

please note I don't want to reinstall windows on my PC or reset it



Solution 1:[1]

What worked for me was this: setting TEMP and TMP to something short like

set TEMP=c:\temp 
set TMP=c:\tmp 
vs_community.exe

(Microsoft lacks logic and its website gives a weird hint about "installation path" being less than 80 characters)

Solution 2:[2]

As you can see the installer thinks your path is:

C:\Users\Daniyal Shaikh\AppData\Local\Temp;\dd_bootstrapper_20211113154956.log

It's adding that semicolon in your TEMP path. If you open your advanced system settings in windows, environmental variables, and edit the TEMP variable you will see a semicolon at the end. Click edit, and then EDIT TEXT, remove the semicolon and save. The installer should now open!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 John Carpenter
Solution 2 calisoup