Developers Club geek daily blog

1 year, 1 month ago
We decided to transfer somehow the project to the Visual Studio 2015 — there to so many fascinatingfeatures ! Yesterday here only solved, and already this morning I started its installer. The sky was cloudless, nothing portended trouble. Well, really, can go not so? How many already these Visual Studios it is rearranged — not to consider (I, am remembered, 6.0 more once put). Who could think that this most trivial task can develop into very unexpected running on a rake long almost in the whole working day.

Having crackled a little hard drive, the beautiful installer showed me absolutely ugly error message. Here it:
Investigation of a setup error of the Visual Studio of 2015

Hm. It was not put means, Team Explorer and couple more of minor packets. Well ok. We close, we reinstall. Does not help. We delete studio, we reboot, we set — the same error. We climb in Google with a question of a setup error of the Visual Studio of 2015 at a stage of installation of the Team Explorer component and we understand that the problem is mass — tens of links with the same description:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17

Specialists of the first line of technical support of Microsoft whose councils are reduced to "answer all these questions disconnect an antivirus", "check a cheksuma of an image with studio", "check a disk for errors". Nothing from this, of course, helps what they and are told about then they vanish and do not answer any more. Very friendly user support, you will tell nothing.

Well, it is time to include the head, to take tools in hand and to understand. Went.

So, everything that we have, is an input point of an error — a problem with Team Explorer. And a reference on a log file on the screenshot given above. Well ok, let's go we esteem that there the log file thinks of our error.

Log
[15FC:1A18][2015-11-26T17:30:17]i000: MUX:  ExecutePackageBegin PackageId: vs_teamExplorerCore
[2118:2240][2015-11-26T17:30:17]i301: Applying execute package: vs_teamExplorerCore, action: Install, path: C:\ProgramData\Package Cache\{791295AE-3B0A-3222-9E69-26C8C106E8D1}v14.0.23102\packages\TeamExplorer\Core\vs_teamExplorerCore.msi, arguments: ' MSIFASTINSTALL="7" USING_EXUIH="1"'
[15FC:1A18][2015-11-26T17:31:06]i000: MUX:  ExecuteError: Package (vs_teamExplorerCore) failed: Error Message Id: 1722 ErrorMessage: There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.  
[2118:2240][2015-11-26T17:31:09]e000: Error 0x80070643: Failed to install MSI package.
[2118:2240][2015-11-26T17:31:09]e000: Error 0x80070643: Failed to execute MSI package.
[15FC:1A18][2015-11-26T17:31:09]e000: Error 0x80070643: Failed to configure per-machine MSI package.
[15FC:1A18][2015-11-26T17:31:09]i000: MUX:  Installation size in bytes for package: vs_teamExplorerCore MaxAppDrive: 0  MaxSysDrive: 440487936  AppDrive: 0  SysDrive: 263573504
[15FC:1A18][2015-11-26T17:31:09]i000: MUX:  Return Code:0x80070643 Msi Messages:There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.   Result Detail:0 Restart:None
[15FC:1A18][2015-11-26T17:31:09]i000: MUX:  Set Result: Return Code=-2147023293 (0x80070643), Error Message=There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.  , Result Detail=, Vital=True, Package Action=Install, Package Id=vs_teamExplorerCore
[15FC:1A18][2015-11-26T17:31:09]i000: Setting string variable 'BundleResult' to value '1603'
[15FC:1A18][2015-11-26T17:31:09]i319: Applied execute package: vs_teamExplorerCore, result: 0x80070643, restart: None
[15FC:1A18][2015-11-26T17:31:09]e000: Error 0x80070643: Failed to execute MSI package.




Everything that can be understood from this log, is that the component was put-was put and something was not put. Happens supposedly what there. Well, thanks a lot for information!

All right, let's come on the other hand. Team Explorer it (as well as almost everything in modern Visual Studio versions) — VSIX (a component, expansion). It is put separately from a kernel of studio by the special VSIXInstaller.exe program which lives in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE and is able to write at installation of these VSIX components to the temporary folder (well, that, which % %TEMP) a log about how everything passed. We go to % %TEMP, we find on error time from a log above the file corresponding to the Team Explorer installation. Here it:

Log
26.11.2015 17:31:01 - Microsoft VSIX Installer
26.11.2015 17:31:01 - -------------------------------------------
26.11.2015 17:31:01 - Initializing Install...
26.11.2015 17:31:01 - Extension Details...
26.11.2015 17:31:01 - 	Identifier      : Microsoft.VisualStudio.TeamFoundation.TeamExplorer.Extensions
26.11.2015 17:31:01 - 	Name            : Team Foundation Team Explorer Extensions
26.11.2015 17:31:01 - 	Author          : Microsoft
26.11.2015 17:31:01 - 	Version         : 14.0.23102
26.11.2015 17:31:01 - 	Description     : Team Foundation extensions for Team Explorer
26.11.2015 17:31:01 - 	Locale          : en-US
26.11.2015 17:31:01 - 	MoreInfoURL     : 
26.11.2015 17:31:01 - 	InstalledByMSI  : False
26.11.2015 17:31:01 - 	SupportedFrameworkVersionRange : [0.0,2147483647.2147483647]
26.11.2015 17:31:01 - 
26.11.2015 17:31:06 - 	SignedBy        : Microsoft Corporation
26.11.2015 17:31:06 - 	Certificate Info : [Subject]
  CN=Microsoft Corporation, OU=MOPR, OU=OPC, O=Microsoft Corporation, L=Redmond, S=Washington, C=US

[Issuer]
  CN=Microsoft Code Signing PCA 2010, O=Microsoft Corporation, L=Redmond, S=Washington, C=US

[Serial Number]
  33000000A81581DB462EBDD9480000000000A8

[Not Before]
  05.03.2015 1:42:40

[Not After]
  05.06.2016 2:42:40

[Thumbprint]
  EFCF3B47C17854AB6E4C63821DE31A59B24D62B2

26.11.2015 17:31:06 - 	Supported Products : 
26.11.2015 17:31:06 - 		Microsoft.VisualStudio.IntegratedShell
26.11.2015 17:31:06 - 			Version : [14.0]
26.11.2015 17:31:06 - 		Microsoft.VisualStudio.Express_All
26.11.2015 17:31:06 - 			Version : [14.0]
26.11.2015 17:31:06 - 
26.11.2015 17:31:06 - 	References      : 
26.11.2015 17:31:06 - 
26.11.2015 17:31:06 - Searching for applicable products...
26.11.2015 17:31:06 - System.TypeInitializationException: The type initializer for 'VSIXInstaller.SupportedSKUs' threw an exception. ---> System.BadImageFormatException: Could not load file or assembly 'Microsoft.VisualStudio.Settings.14.0.dll' or one of its dependencies.  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
   at VSIXInstaller.SupportedSKUs.AddInstalledIsolatedShells(Version vsVersion)
   at VSIXInstaller.SupportedSKUs..cctor()
   --- End of inner exception stack trace ---
   at VSIXInstaller.SupportedSKUs.get_SupportedSKUsList()
   at VSIXInstaller.App.InitializeInstall(Boolean isRepairSupported)
   at VSIXInstaller.App.OnStartup(StartupEventArgs e)
26.11.2015 17:31:06 - System.TypeInitializationException: The type initializer for 'VSIXInstaller.SupportedSKUs' threw an exception. ---> System.BadImageFormatException: Could not load file or assembly 'Microsoft.VisualStudio.Settings.14.0.dll' or one of its dependencies.  is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)
   at VSIXInstaller.SupportedSKUs.AddInstalledIsolatedShells(Version vsVersion)
   at VSIXInstaller.SupportedSKUs..cctor()
   --- End of inner exception stack trace ---
   at VSIXInstaller.SupportedSKUs.get_SupportedSKUsList()
   at VSIXInstaller.App.OnExit(ExitEventArgs e)




Well, here already more than any interesting it is written, of course. We are interested the first moment when something went not so. Here it:

26.11.2015 17:31:06 - System.TypeInitializationException: The type initializer for 'VSIXInstaller.SupportedSKUs' threw an exception. ---> System.BadImageFormatException: Could not load file or assembly 'Microsoft.VisualStudio.Settings.14.0.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Hm, there was an error in attempt to load assembly of Microsoft.VisualStudio.Settings.14.0.dll. My first thought was the fact that the studio somehow got confused in an installation procedure of the components and tries to use at installation something that was not established yet where it is necessary. So, we have in system such library?

It appeared — is. Lies in GAC, there where it and should lie:

Investigation of a setup error of the Visual Studio of 2015

So that turns out? Assembly is, it is where it is necessary, but is not loaded. Perhaps, beaten? We take IL DASM, we load — everything is OK.

Investigation of a setup error of the Visual Studio of 2015

Maybe handymen from Microsoft managed to write such installer at which sometimes it turns out not to find assembly in GAC? We take Process Monitor, we add to it the filter on opening of files and again we start an installer of studio. We reach an error, we look a log.

Investigation of a setup error of the Visual Studio of 2015

So, the installer looks for Microsoft.VisualStudio.Settings.14.0.dll and finds it exactly where it also has to be — in GAC. Ok that not so?
We read once again an error message: "System.BadImageFormatException: Could not load file or assembly 'Microsoft.VisualStudio.Settings.14.0.dll' or one of its dependencies. is not a valid Win32 application.". So, if Microsoft.VisualStudio.Settings.14.0.dll is and is valid — there can be a matter in one of its dependences? We return to Process Monitor and we watch what there is loaded directly after our assembly.

Investigation of a setup error of the Visual Studio of 2015

Aha, vcruntime140.dll is loaded. It is redistributable-library from the Visual Studio 2015. Well, it precisely had to be put at one of the first stages of installation! But let's check, than already the devil does not joke.

Check of times — in the list of the installed programs:

Investigation of a setup error of the Visual Studio of 2015

Check two — in the C:\Windows\SysWOW64\ folder:

Investigation of a setup error of the Visual Studio of 2015

Check three is, actually, "SUCCESSS" in Process Monitor log:
Investigation of a setup error of the Visual Studio of 2015

The last check — in general steel concrete argument: you see, looked, tried to open, opened successfully — the file naydyon means. Everything, suspicions are removed, we go further. So, what - library the installer of VSIX tries to load Process Monitor following on logs?

Investigation of a setup error of the Visual Studio of 2015

How it is vcruntime140.dll already in other folder again?! It turns out, having found vcruntime140.dll in the C:\Windows\SysWOW64\ folder and it is successful it having opened (and we know that and on logs it was higher!) the loader of dependences nevertheless for some reason considered it insufficiently good and discarded. How so?! It that — not maykrosoftovsky library? We watch properties:

Investigation of a setup error of the Visual Studio of 2015

Well, normal library. Why it was not loaded? Let's look at it more attentively. For this purpose as a part of any Visual Studio version there is an excellent utility of dumpbin. We start it with here such keys:

dumpbin /headers c:\windows\SysWOW64\vcruntime140.dll


also we look at results:

Microsoft (R) COFF/PE Dumper Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file c:\windows\SysWOW64\vcruntime140.dll

PE signature found

File Type: DLL

FILE HEADER VALUES
            8664 machine (x64)
               7 number of sections
        558CE2FF time date stamp Fri Jun 26 08:28:31 2015
               0 file pointer to symbol table
               0 number of symbols
              F0 size of optional header
            2022 characteristics
                   Executable
                   Application can handle large (>2GB) addresses
                   DLL
....


Wait-wait … And why it you, bibliotechka, 64-bit?! You lie in the C:\windows\SysWOW64\ folder where generally the place only to 32-bit libraries! And well let's look what then lies in C:\Windows\System32?

Investigation of a setup error of the Visual Studio of 2015

And the same (who does not trust in the size — you can check some WinMerge, they are identical). You already caught in what an essence? The error crept in in the installer of Redistributable-components entering an installer of the Visual Studio of 2015 — it just puts 64-bit versions of rantaym-libraries and in the folder for 64-bit libraries (C:\Windows\System32) and in the folder for 32-bit (c:\windows\SysWOW64\). As a result in further attempt of use of the 64-bit version everything will be ok, and here in attempt of loading of the 32-bit version there will be what we saw at the Team Explorer installation — mysterious errors in general without mentioning of vcruntime140.dll library and a Redistributable-packet. Also do that you want.

And what we want to do? And to delete x86-part of a Redistributable-packet of the Visual Studio 2015, to download it separately from the website of Microsoft and to reinstall. A surprise — on the website of Microsoft the version correct, it will set the 32-bit version of library in C:\windows\SysWOW64 then it is possible to restart the Visual Studio installation 2015 and it will successfully reach the end!

Happy end.

Investigation of a setup error of the Visual Studio of 2015

It was necessary to explain somehow to the administration why I set the whole day the Visual Studio if children in the third class for an hour cope with it. In general for the sake of this purpose this article was also written, and why you read it — I do not know :)

P.S. To be fair it should be noted that search in the same problem with mentioning of the words "redistributable" and "vcruntime140" after all brings to Stackoverflow which is alone rolling on a roadside a question with the correct answer (someone passed the same way, as I!), which in a type of the low mark is not perceived by people as this solution. Let's not take away from the author of that answer a palm and to produce excess entities if the problem described in article concerned also you, and the proposed solution helped — you can vote for this answer to Stackoverflow.

This article is a translation of the original post at habrahabr.ru/post/271809/
If you have any questions regarding the material covered in the article above, please, contact the original author of the post.
If you have any complaints about this article or you want this article to be deleted, please, drop an email here: sysmagazine.com@gmail.com.

We believe that the knowledge, which is available at the most popular Russian IT blog habrahabr.ru, should be accessed by everyone, even though it is poorly translated.
Shared knowledge makes the world better.
Best wishes.

comments powered by Disqus