Building Directory contains space

Hello

I have a problem with building/running a monogame cross platform desktop application. I am using monodevelop 7.7 (1869) on ubuntu 18.04.1 and when i’m trying to run it with the default settings of monodevelop it says this:

Cannot open assembly '.../bin/DesktopGL/Any CPU/Debug/TutorialCrossPlatform.Desktop.exe': No such file or directory.

Also there is no such file under that directory. But when I simply build the solution (build all with F6) it tells me that the build is successful. But there is no such file generated anywhere in that solution.

I assume it’s the space in the directory but unfortunately I have not found yet where I could change the directory.
I already asked in the MonoDevelop Gitter but they pointed me to this forum.

I would be grateful if someone could help me.

1 Like

This is an old topic but I do have a trick that works if anyone still needs to know.

When starting a new solution - uncheck “[] Create project directory within the solution directory” (don’t really need it anyway) and you may notice a red X beside “MyProjectName.Desktop” (for example) that says “invalid configuration” when you hover over the X.

  1. Right click on it
  2. Tools >> Edit
  3. Ctrl-H (replace ALL) “Any CPU” with “AnyCPU” [no space]
  4. File >> Save, Clean All, rebuild - should work.
6 Likes

Hi,

I tried your way and it works. I would like to know a bit more about why this problem is caused. If you know another forum where the issue is solved could you share it,

Thanks.

1 Like

I remembered someone said on Linux, spaces in a path can mess things up and they require special characters to work so I figured it was probably the “Any CPU” causing it to not make the exe in the desired path.

Yes, as far as i know it thinks […]/Any is the first argument and Cpu/[…] is the second argument. Its quite easy to fix, though. I don’t know how it’s creating the folders but if its using mkdir then it could instead put the name in quotes like mkdir "Any Cpu" or just escaping the character with mkdir Any\ Cpu. The last is what the terminal does when you hit tab and it auto fills a path.