none
Cannot run stand alone application on windows 10 computer RRS feed

  • Question

  • I am currently developing an application using C++ CLI in visual studio.

    I am using Visual Studio Community version 2017.

    I am developing the application on a computer running windows 7.

    After building to the application I put it on my memory stick and I test it on other computers.

    So far i tested it on windows 7 and windows 10.

    windows 7 is working fine, but i tried it on two windows 10 computers and it gave me the following error:

    "The code execution cannot proceed because ucrtbased.dll was not found. Reinstalling the program may fix this problem."

    I am looking for a permanent solution to this problem, meaning that the customer should have the application work on their

    windows 7 8 and 10 computer without any hassle.

    Friday, June 14, 2019 2:37 PM

All replies

  • The library ucrtbased.dll implies you are trying to deploy the debug version of your application.

    Because the EULA only really allows the redistribution of the release version of these libraries, there aren't really any complete redistributables for the debug libraries. So when it comes time for redistributing to customers, you must release the version that is built in the Release configuration.

    The only officially supported way of installing ucrtbased.dll on a computer is by installing the Windows 10 SDK IIRC. However the way you can provide the debug version of your application for testing purposes only is by copying the file from the Windows 10 SDK directory into the same directory as the executable that you are running. You should then also copy the Visual C++ debug runtime into the same directory just to be sure.

    When it comes to the release version of your application, all you need to do is install the Visual C++ redistributable and everything will be installed ready. If you can't/don't want to install the redistributable, then you can do the same thing by copying ucrtbase.dll and the associated API set DLLs that go along with it as well as the Visual C++ runtime into the same directory.

    The path to the debug versions of the libraries that you need are:

    <Path to the Windows 10 SDK>\bin\<Windows SDK version>\<platform>\ucrt

    <Path to Visual Studio 2017>\VC\Redist\MSVC\<compiler version>\debug_nonredist\<platform>\Microsoft.VC141.DebugCRT

    The default paths for the Windows 10 SDK and Visual Studio 2017 are:

    C:\Program Files\Windows Kits\10

    and

    C:\Program Files\Microsoft Visual Studio\2017\<Edition>

    for 32 bit systems and:

    C:\Program Files (x86)\Windows Kits\10

    and

    C:\Program Files (x86)\Microsoft Visual Studio\2017\<Edition>

    For 64 bit systems. This assumes that your system drive is C:. The Edition is one of Community, Professional or Enterprise depending on what version you are using. The platform for the libraries needs to match the platform that you are building your application for. So if you have set Visual Studio's configuration to x86 Debug then you would need the x86 version of the libraries even if you are running a 64 bit version of Windows.

    The release versions of these libraries, if you want to distribute without installing the redistributable are at:

    <Path to the Windows 10 SDK>\Redist\ucrt\DLLs\<platform>

    and

    <Path to Visual Studio 2017>\VC\Redist\MSVC\<compiler version>\<platform>\Microsoft.VC141.CRT

    But if you want the redistributables then you can find them in:

    <Path to Visual Studio 2017>\VC\Redist\MSVC\<compiler version>

    or on the Visual Studio's website.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Friday, June 14, 2019 4:56 PM
  • I am looking for a permanent solution to this problem, meaning that the customer should have the application work on their windows 7 8 and 10 computer without any hassle.

    The only way to do that is to build a release version. If you do that then you might be able to distribute the application just by copying the exe but a professional solution involves some kind of setup program. You don't say what type of application it is but VS probably has a deploy feature for the project. You should ask in a forum appropriate for your project type, such as C++ Windows API, Windows Forms, WPF, UWP or whatever.



    Sam Hobbs
    SimpleSamples.Info

    Sunday, June 16, 2019 9:30 PM
  • Hi RobotNerd94,

    Does your issue is solved or not? If not, could you please share the update information when you run the application?

    If you already found the solution, please share it in here or mark the helpful reply, that will help other community members, we can also close this thread for you, thanks for your understanding.

    Best Regards,

    Dylan


    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

    Wednesday, June 19, 2019 11:30 AM