if i change the location of my project the form designe stops loading

MD. ALAMIN HOSSEN 20 Reputation points
2023-01-17T20:35:19.2+00:00

I was working on windows forms application but it stops loading the form designe after I came back to work on it after few weeks.

this happens when i copy the project and move it to another folder.

if I want to change the folder of the project what can I do so this error does not happen?

1

2

Developer technologies | Windows Forms
Developer technologies | Visual Studio | Other
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 34,451 Reputation points Microsoft External Staff
    2023-01-18T03:23:50.33+00:00

    Hello @MD. ALAMIN HOSSEN, 

    Welcome to Microsoft Q&A forum.

    From the first screenshot, I can see that the error said: Path: … exceeds the OS max path limit. The fully qualified file name must be less than 260 characters. The OS(Windows OS) does have this well-known restriction. See this document: Maximum Path Length Limitation.

    In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string<NUL>" where "<NUL>" represents the invisible terminating null character for the current system codepage. (The characters < > are used here for visual clarity and cannot be part of a valid path string.)

    If I want to change the folder of the project what can I do so this error does not happen?

    As it’s the OS restriction, the solution is moving your solution to another directory which is closer to the root.

    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.