MS Visual Studio 2022 not able to open source files with path length more than 120 characters

Tony Josi 20 Reputation points
2024-05-14T10:37:08.3+00:00

While building a project on the MS visual studio 2022. I'm getting the following error:

Error   C1083   Cannot open source file: '..\..\..\..\Source\Application-Protocols\network_transport\tcp_sockets_wrapper\ports\freertos_plus_tcp\tcp_sockets_wrapper.c': No such file or director

If I rename file/folder names to make the length of the path less than or equal to 120 (current length is 124), the error goes away and the project is built successfully.

I think this might be due to a setting that disallows paths greater than particular length, but I'm not sure where to update that.

VS project

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,721 questions
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 28,056 Reputation points Microsoft Vendor
    2024-05-15T07:28:11.4866667+00:00

    Hi @Tony Josi ,

    so it seems like there isn’t a portable or straight-forward solution yet, is that right?

    Yes. For Visual Studio, currently, it’s still a limit.

    Shortening the path or using a short path is a workaround.

    Best Regards,

    Tianyu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful