0

I started a brand new project on Windows x64. When i'm trying to do anchor build it is not working and I get the following output:

Failed to obtain package metadata: 'cargo metadata' exited with an error: error: failed to load manifest for workspace member '\?\C:\Users\thugu\Documents\OneDrive\OneDrive_Doc\Crypto-project\solequapp\programs*'

Caused by: failed to read '\?\C:\Users\thugu\Documents\OneDrive\OneDrive_Doc\Crypto-project\app\programs*\Cargo.toml'

Caused by: The filename, directory name, or volume label syntax is incorrect. (os error 123)

Looking into my programs folder on my project, programs\app i can found the Cargo.toml file. Maybe is there a problem on the path that is trying to read (it says app\programs*\ not app\programs\app\ as it should be by the directory) Is there a way to change that path? thanks

1 Answers1

0

I had the same issue, working with VS studio in Windows 11. Resolving this issue took me quite a few steps.

First I came to the conclusion that 'anchor build' wasn't working on a windows environment so you have yo use WSL (windows system for Linux).

I read the following: "But "anchor test" still doesn't work, because the solana-test-validator can't run on windows , and seems that solana' dev team don't resolve this problem. solana 4608 So I think you should use linux system or other vm(vitrualbox) to develop". I have no verified this information but you can check this thread: https://github.com/coral-xyz/anchor/issues/1992

You can setup visual code studio with WSL with the help of this page: https://code.visualstudio.com/docs/remote/wsl#_developing-in-wsl

but prior to that, you need to enable Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS. If this feature is not enabled, you cannot use WSL. I'm mentioning this because it took me a lot of time figuring out why UBUNTU wasn't working.

To enable this feature, or check wether its enabled or not, go to: https://pureinfotech.com/enable-hyper-v-windows-11/ or go to: https://www.simplilearn.com/enable-virtualization-windows-10-article and navigate to the explanation of your windows verions. I had to enable this feature in my BIOS settings under -> configuration -> virtualization technology.

Hope this helps anyone stumbling on this page using Windows ;)

DavidPostill
  • 162,382