Skip to content

DSC depends on vcruntime140.dll but does not declare it #1244

Closed

Description

Every executable in the DSC package has a load time dependency on vcruntime140.dll, which it probably does not need. It works on most machines by virtue of other applications installing such DLL in system32. It will not work on a clean machine.

You can work around this by statically linking components of the C++ runtime, while still dynamically linking the C runtime. This is referred to as the "Hybrid CRT" model.

Here's how you do it in Rust:

https://github.com/microsoft/edit/blob/82cc84a610ded54d57f956285a8c4307c74bf364/.cargo/release-windows-ms.toml#L3-L13

...and here's how you do it in MSBuild/vcxproj:

https://github.com/microsoft/terminal/blob/4b946c0d5cc0264ff0529643f9455fd2c6c227b4/src/common.build.post.props#L7-L41

A little more information is available in the WinAppSDK docs, but be aware that you do not need to consume WinAppSDK to use HybridCRT.

Activity

  1. DHowett commented on Nov 7, 2025

    @DHowett
    Author

    This was reportedly fixed in #269, but it seems to have regressed.

  2. marcdrexel commented on Nov 11, 2025

    @marcdrexel

    Steve Lee (@SteveL-MSFT)
    as of 3.1.2 dsc.exe now fails to run if VCRUNTIME140.dll is not found.
    Image

    3.1.1 works as normal, i tested this on a fresh windows server 2025 standard installation.

    are we expected to also install Visual C++ Redistributable starting with 3.1.2 or is this a bug?

  3. DHowett commented on Nov 11, 2025

    @DHowett
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions