Skip to content

libnethost is only provided with release CRT #64087

@elinor-fung

Description

@elinor-fung

By default, a C++ application in VS uses the debug version of the C runtime library when building with Configuration=Debug. Since we only ship a release libnethost.lib using the release CRT, if a consumer tries to link it in, they will hit mismatches between the runtime libraries (LNK2038). In order to consume the static libnethost.lib, they have to change the defaults for the Debug configuration to use the release version of the C runtime library.

Kind of a continuation of our 'we lack a defined/worn path for shipping native assets'. Possibilities:

  • Ship a libnethostd.lib (and .pdb) on Windows that uses the debug CRT
    • Would add about 4MB
  • Maintain and push people to vcpkg
    • Port for nethost is there, but, to my knowledge, we have not been maintaining/updating
  • Only support using the release CRT if using static nethost (and document)
    • Consumers would need to compile with /MT and not define _DEBUG (this is what DNNE is doing, cc @AaronRobinsonMSFT)

cc @vitek-karas

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions