Version 1.14.7 error when publishing: No such file or directory
Installed product versions
- Visual Studio: [2022 Professional]
- This extension: [example 1.1.21]
Description
With version 1.14.6 all works fine. (Even after downgrading from 1.14.7 to 1.14.6 again.)
After updating to 1.14.7 I get the following as part of the docker log:
Output of Docker Log #18 9.386 WebCompiler: Begin compiling compilerconfig.json #18 9.502 WebCompiler installing updated versions of the compilers... #18 9.523 /root/.nuget/packages/buildwebcompiler2022/1.14.7/build/BuildWebCompiler2022.targets(12,9): error : An error occurred trying to start process 'cmd.exe' with working directory '/tmp/WebCompiler1.14.7'. No such file or directory [/src/Wxxx/Identity/Server/Wxxx.Identity.Provider/Wxxx.Identity.Provider.csproj] #18 9.533 #18 9.533 Build FAILED.
Steps to recreate
- Try to publish project to docker
Current behavior
The build fails with error message above
Expected behavior
Build succeeds like with 1.14.6
Is there any way you can help me replicate this? I have no experience with Docker; a sample application demonstrating the issue would be invaluable.
Also getting this error. The problem seems to stem from the attempt to start cmd.exe in a Linux container. Will try to publish a sample ASAP.
The problem still resides in 1.14.8. I agree to comment of NickNirus. Publishing to (a linux) docker image compiles project on linux where no cmd.exe exists...
I can confirm this too.
I'm on linux and when I try to run the app I get this error:
/home/mast/.nuget/packages/buildwebcompiler2022/1.14.8/build/BuildWebCompiler2022.targets(12,9): error : An error occurred trying to start process 'cmd.exe' with working directory '/tmp/WebCompiler1.14.8'. No such file or directory [/home/mast/workspace/Solution/src/Solution/Solution.csproj]
This appears to have broken when I upgraded the nuget package; the working version was using the last version of Mads’ extension from nuget; I don’t have a Linux machine or a Docker instance at the moment; I’m open to pull requests or suggestions if anyone has any idea what would have broken this since the old extension also used cmd.exe to run the compilers.
This appears to have broken when I upgraded the nuget package; the working version was using the last version of Mads’ extension from nuget; I don’t have a Linux machine or a Docker instance at the moment; I’m open to pull requests or suggestions if anyone has any idea what would have broken this since the old extension also used cmd.exe to run the compilers.
Hmm, if you are on windows maybe try WSL to check. Otherwise, I'm not familiar enough with C# and Blazor to actually help 😅
I think it wasn't possible to build on a linux machine / container before 1.14.7. But due to another error the compilation didn't start when building. (See comments for version 1.14.7.) So a build didn't fail because WebCompiler wasn't startet at all. With 1.14.7 WebCompiler get's started during build and that makes the build fail. I deactivated the ~Compile on build~ option in the context menu. So I have to compile resources manually before build and publishing to a linux docker container...
I have a potential solution. The only problem is I have no idea how to build the nuget package for local testing.
We could potentially check what OS we are running on during the compile process and switch to using a platform appropriate shell to execute the command. On linux that would be something like sh or bash while still using cmd.exe on Windows.
We would also need to unpack resources without the 7zip executable as it's not portable to Linux or OSX.
@randomman552 I only have a windows machine, so I'll need someone to submit a PR and commit to maintaining this functionality.
https://github.com/madskristensen/WebCompiler/issues/295, https://github.com/madskristensen/WebCompiler/issues/260, and many others indicate that there is no support for WebCompiler on Mac and probably Linux machines.
The WebCompiler version used here is not maintained anymore, as per https://github.com/madskristensen/WebCompiler/issues/468, and they recommend looking at https://github.com/excubo-ag/WebCompiler rather that is more OS agnostic