locked
Visual C++ Build Tools doesn't install ucrtbased.dll RRS feed

  • Question

  • To reproduce:

    1. Download Visual Studio Build Tools 2015.
    2. Install it. I selected the Windows 10 SDK, but not the Windows 8.1 SDK.
    3. Create a trivial main.cpp:   int main() { return 0; }
    4. Start->Run->Visual C++ 2015 x86 Native Build Tools Command Prompt  (catchy!)
    5. cl /MDd main.cpp
    6. link main.obj
    7. main

    This will tell you that ucrtbased.dll is missing. If you link against the release CRT (omit /MDd) then it works fine.

    Looking in c:\Windows\System32 and c:\Windows\SysWOW64 you will find that ucrtbase.dll is present but ucrtbased.dll is not! Various other places on the internet will tell you to reinstall Visual Studio (I'd link but you have a stupid anti-linking policy), but I'm not using Visual Studio. I've tried reinstalling / repairing Visual Studio Build Tools but it didn't work.

    ucrtbased.dll is installed on to the system, in various places under c:\Program Files (x86)\Microsoft SDKs\Windows Kits\10 and c:\Program Files (x86)\Windows Kits\10. I did try copying a 64-bit one to c:\Windows\system32 (yes), and a 32-bit one to c:\Windows\SysWOW64. It worked for 64-bit programs but for some reason when you compile a 32-bit program it still looks in c:\Windows\system32 first, finds the 64-bit DLL and then crashes. I'm not really sure how SysWOW64 is supposed to work so I didn't get any further.

    In any case, this appears to be a bug.

    Friday, February 3, 2017 4:01 PM

Answers

  • Well actually it turns out that those people saying to reinstall Visual Studio were right. I thought it wouldn't work because I previously tried the 'Repair' option (which I figured would be equivalent to uninstall/reinstall) and it didn't work. But I just tried a total uninstall and reinstall and now I have ucrtbased.dll in c:\Windows\system32!

    So, lesson learned. Never use the 'repair' option in installers.

    • Marked as answer by Timmmmo Friday, February 3, 2017 4:34 PM
    Friday, February 3, 2017 4:33 PM

All replies

  • Well actually it turns out that those people saying to reinstall Visual Studio were right. I thought it wouldn't work because I previously tried the 'Repair' option (which I figured would be equivalent to uninstall/reinstall) and it didn't work. But I just tried a total uninstall and reinstall and now I have ucrtbased.dll in c:\Windows\system32!

    So, lesson learned. Never use the 'repair' option in installers.

    • Marked as answer by Timmmmo Friday, February 3, 2017 4:34 PM
    Friday, February 3, 2017 4:33 PM
  • Hi Timmmmo,

    Thank you for posting in MSDN forum.

    Glad you solved this issue successfully and It's really kind of you to share your solution and result here.

    I will take it as a note, in case that other members face similar issue.

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, February 6, 2017 7:05 AM