-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Description
Description
Similar to #92335, enabling AOT compilation for a project that contains a space will fail.
Reproduction Steps
Pretty simple. Create a new standalone webassembly project and name it "Space Test". Enable AOT compilation with <RunAOTCompilation>true</RunAOTCompilation> in the csproj property group, then run dotnet publish in the solution folder.
Expected behavior
AOT compilation should not fail due to a space in the path/project.
Actual behavior
Compilation fails.
Regression?
No response
Known Workarounds
Remove spaces from path and projects. This "worked" for me in my production project simply for testing purposes, however, similar to the other issue I filed, I wouldn't want to change this permanently.
Configuration
Windows 11
Dotnet 8.0.204
Other information
I did not test this on another OS, hence why I titled this Windows, but given I had issues with MacOS before it's likely worth testing on that OS as well. I'm unable to do so right now as I file this ticket.
Error output:
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.4\Sdk\WasmApp.Native.targets(686,5): error : Precomp
iling failed for C:\Users\EddieHartman\source\repos\Space Test\Space Test\obj\Release\net8.0\wasm\for-publish\aot-in\aot-ins
tances.dll with exit code 1. [C:\Users\EddieHartman\source\repos\Space Test\Space Test\Space Test.csproj]
C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\8.0.4\Sdk\WasmApp.Native.targets(686,5): error : Can not
open image C:\Users\EddieHartman\source\repos\Space [C:\Users\EddieHartman\source\repos\Space Test\Space Test\Space Test.cs
proj]
As you can see, the giveaway for me that the space was the issue was here and how it gives up upon encountering the space: "Can not open image C:\Users\EddieHartman\source\repos\Space "
Unlike the other issue though, I had to change the parent folder name and the project name in order to get things to compile properly, so the whole path needs quoted, escaped, whatever needs to go on to enable AOT compilation.