Building blinky demo: VCTargetsPath issue

Hello everyone.
This is the first time I’m using FreeRTOS and I’m trying to install and configure everything to get started. Hope I’m writing this message in the right page of this forum.
Unfortunately I’m not even able to build the starting main_blinky demo example on Windows (by setting mainCREATE_SIMPLE_BLINKY_DEMO_ONLY to 1).

ENVIRONMENT DETAILS
OS: Windows 11 Home, 64 bits
Visual Studio Code version: 1.98.2
Downloaded FreeRTOS folder: git cloned from here —> githubDOTcom/FreeRTOS/FreeRTOS?tab=readme-ov-file

ISSUE
When I try to build the project (I never used dotnet before, I just ran both “dotnet build WIN32.sln” command from terminal and build it from the Solution Explorer within Visual Studio Code), the output error message that you can see in the below attachment is returned.

TRIED SOLUTIONS
I found these solutions on the internet and tried them (none of them worked):

  • downgrade Visual Studio Code to version 1.17.2
  • add the Windows Registry Keys "VCTargetsPath REG_SZ $(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0" to both these paths:
    • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0
    • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\MSBuild\ToolsVersions\4.0

Other solutions were found, but I wasn’t too much confident about them. I’m wondering if something is missing in the whole configuration needed to build everything.
Feel free to reach me out if more details are needed to better understand the issue.

Thank you in advance. Best regards !
Lorenzo

Would you please try the following:

  1. Clone the repository: git clone https://github.com/FreeRTOS/FreeRTOS.git --recurse-submodules.
  2. Open the file FreeRTOS/Demo/WIN32-MSVC/WIN32.sln by double clicking. This should open the solution in Visual Studio.
  3. Clink on Build --> Build Solution menu item.

Thank you for your reply !
Yes, I already cloned the repository with that git clone command.
Running the build with the usual Ctrl+Shift+B, the suggestion “No build task to run found. Configure Build Task…” is shown. Should I configure somehow such a task ?

Hi @Lorenzo
Welcome to the FreeRTOS Community Forums!

I think you are trying to build the demo in Visual Studio Code.

.sln (Solution) files are for Visual Studio (the full IDE). They are not directly used by VS Code. Visual Studio understands .sln and .vcxproj files to manage C/C++ projects, build configurations, dependencies, etc. When you press Ctrl+Shift+B in Visual Studio, it builds using MSBuild behind the scenes via the .sln.

If you’re using VS Code, you have to tell it how to build, typically using:

  • tasks.json for custom commands (e.g. make, cmake, gcc)
  • launch.json for debugging
  • c_cpp_properties.json for IntelliSense and include paths

As @karahulx suggested, please install Visual Studio and see if you can then build - Visual Studio 2022 Community Edition – Download Latest Free Version.