Problems with whitespaces on windows username at build command

Hello guys!

This is my first post here, so, tell me please if is something wrong.

Well, the problem is very estrange; i cant compile any empty .net core project using directly the cli, or visual studio. The resulting command is the following:

Sorry for the spanish output:

‘’’ bash
Microsoft ® Build Engine versión 16.7.0+b89cb5fde para .NET
Copyright © Microsoft Corporation. Todos los derechos reservados.

Determinando los proyectos que se van a restaurar…
Todos los proyectos están actualizados para la restauración.
No se pudo ejecutar porque no se encontró el comando o archivo especificados.
Algunas de las posibles causas son:
* Escribió mal un comando dotnet integrado.
* Intentó ejecutar un programa .NET Core, pero dotnet-C:\Users\Sandl no existe.
* Tiene planeado ejecutar una herramienta global, pero no se encontró un ejecutable con prefijo dotnet con este nombre en la RUTA DE ACCESO.
C:\Users\Sandl Okino.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\MonoGame.Content.Builder.Task.targets(138,5): error MSB3073: El comando “dotnet C:\Users\Sandl Okino.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\…\tools\netcoreapp3.1\any\mgcb.dll /quiet /@:“D:\Programacion\c#\game cross test\game cross test\Content\Content.mgcb” /platform:DesktopGL /outputDir:“D:/Programacion/c#/game cross test/game cross test/Content/bin/DesktopGL/Content” /intermediateDir:“D:/Programacion/c#/game cross test/game cross test/Content/obj/DesktopGL/Content” /workingDir:“D:/Programacion/c#/game cross test/game cross test/Content/”” salió con el código 1. [D:\Programacion\c#\game cross test\game cross test\game cross test.csproj]

ERROR al compilar.

C:\Users\Sandl Okino.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\MonoGame.Content.Builder.Task.targets(138,5): error MSB3073: El comando “dotnet C:\Users\Sandl Okino.nuget\packages\monogame.content.builder.task\3.8.0.1641\build\…\tools\netcoreapp3.1\any\mgcb.dll /quiet /@:“D:\Programacion\c#\game cross test\game cross test\Content\Content.mgcb” /platform:DesktopGL /outputDir:“D:/Programacion/c#/game cross test/game cross test/Content/bin/DesktopGL/Content” /intermediateDir:“D:/Programacion/c#/game cross test/game cross test/Content/obj/DesktopGL/Content” /workingDir:“D:/Programacion/c#/game cross test/game cross test/Content/”” salió con el código 1. [D:\Programacion\c#\game cross test\game cross test\game cross test.csproj]
0 Advertencia(s)
1 Errores

Tiempo transcurrido 00:00:02.17

‘’’

Basically says that c:\users\Sandl is a invalid program path, but… the problem is the whitespace on my username!

the build command of monogame dont have quotes surrounding the excecutable path of the monogame content builder task 3.8 so, when the build process try to execute dotnet C:\Users\Sandl Okino.nuget\packages\monogame.content.builder.task\3.8.0.1641… fails because concider the path up to Sandl and the other as an argument.

So… What I can do in this situation?

Exist a method to move all the dotnet core files to the user directory to something other like d:.nuget or other folder without spaces?

Or I have to report this on github?

Anyways guys, all help will be very appreciated.

You’re awesome and monogames too.

Thanks.

Well finally partially solved with a trick

I’ve moved the .nuget folder to other location without white spaces on the path, and setted the NUGET_PACKAGES env var to change the default .nuget location. And well, it works. :slight_smile:

Is a workaround, but this need to be solved on future versions; I guess that I am not the unique person with a username with spaces on it :slight_smile:

Well, thanks guys.

1 Like