0

A few days ago I have posed the question in the header in a Microsoft forum. I was given two options that IMHO are not very good:

  1. Install the VS2015 redistributables on the target machine.
  2. Compile statically so that the code will not call the VS2015 DLL files.

The first option increases dramatically the installation time of my application.

The second option increases dramatically the size of the binary files, increases the build time and inapplicable when compiling with flag /CLR.

It now seems that by moving my development to Visual Studio 2015 I have to drop support for Vista (actually, to Windows 7 too) or provide a poorer product than the one I had previously provided.

Note: I hopped that using Platform Toolset = v140_xp will solve the problem but apparently it won't.

Please enlighten me with a better solution.

Shaul
  • 437
  • 5
  • 17
  • VS2015 redistributables is the proper way of doing it. – Andrew Komiagin Nov 08 '15 at 06:51
  • 1
    Even if you were on an earlier version of Visual Studio, you'd still have this problem. The older version of Windows do not reliably guarantee to have an update that will install the newer MSVCRT DLLs after it was released. [I answered this question with regards to VS 2010 binaries a long time ago.](http://stackoverflow.com/questions/6956747/c-sharp-missing-msvcr100-dll/6963678#6963678) The answer is still valid for VS 2015. [2015 download here](https://www.microsoft.com/en-us/download/details.aspx?id=48145) – selbie Nov 08 '15 at 07:05
  • In older versions of VS you could add the needed DLL files (e.g. msvcp110.dll, msvcr110.dll) to your installation. In my case it solved the problem. Not anymore. Adding vcruntime14.dll only moves the problem one step ahead to a new list of missing DLL files. – Shaul Nov 08 '15 at 08:16
  • Obviously you need to distribute the right set of runtime files. Nothing new there. – David Heffernan Nov 08 '15 at 08:47
  • @DavidHeffernan I disagree. MS provides the "Target" and the "Toolset" options with the intention, or so I understand, that you will be able to create applications that run on older platforms. – Shaul Nov 08 '15 at 09:03
  • You still need to supply the runtime – David Heffernan Nov 08 '15 at 09:11

1 Answers1

2

Things have changed somewhat with VS2015. This article explains what you need to do: http://blogs.msdn.com/b/vcblog/archive/2015/03/03/introducing-the-universal-crt.aspx

In short, the Universal CRT is a Windows component now. It is supplied with Windows 10, and via Windows update on earlier versions. Your options:

  1. Rely on the Windows update packages.
  2. Apply the runtime redistributable.
  3. Link statically, which is strongly discouraged.
  4. Deploy the binaries needed for app-local installation of the runtime.

This final option matches what you currently do. The article says:

App-local deployment of the Universal CRT is supported.  To obtain the binaries for app-local deployment, install the Windows Software Development Kit (SDK) for Windows 10.  The binaries will be installed to C:\Program Files (x86)\Windows Kits\10\Redist\ucrt.  You will need to copy all of the DLLs with your app (note that the set of DLLs are necessary is different on different versions of Windows, so you must include all of the DLLs in order for your program to run on all supported versions of Windows).

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490