Invalid path CARGO_MANIFEST_DIR

env!("CARGO_MANIFEST_DIR") returns the correct path but starting with \\?\ (e.g. \\?\C:\path\to\project\) making the path unusable.

How I can solve that ?

tl;dr It's required to have path longer than 260 characters on windows.

After some tests it's look like the problem wasn't the \\?\ but the fact I used .. (double dot) in the path string.

You need

2 Likes