Skip to content

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

@DHowett

Description

@DHowett

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.

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