Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
325 stars 56 forks source link

GH Actions Build and Deploy failure -- Can't locate csproj #939

Open Syni44 opened 1 year ago

Syni44 commented 1 year ago

I have a .NET 6 static web app that builds successfully within Visual Studio. When attempting to publish via CI/CD, the build fails during the Build And Deploy task.

Publishing to directory /bin/staticsites/ss-oryx/app...

"2022-10-03 01:22:24"|ERROR|Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
/var/nuget/microsoft.typescript.msbuild/4.7.3/tools/Microsoft.TypeScript.targets(320,5): error MSB6003: The specified task executable "node" could not be run. System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'node' with working directory '/github/workspace'. No such file or directory [/github/workspace/WorkFlow-Notes.csproj]
/var/nuget/microsoft.typescript.msbuild/4.7.3/tools/Microsoft.TypeScript.targets(320,5): error MSB6003:    at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) [/github/workspace/WorkFlow-Notes.csproj]
/var/nuget/microsoft.typescript.msbuild/4.7.3/tools/Microsoft.TypeScript.targets(320,5): error MSB6003:    at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) [/github/workspace/WorkFlow-Notes.csproj]
/var/nuget/microsoft.typescript.msbuild/4.7.3/tools/Microsoft.TypeScript.targets(320,5): error MSB6003:    at System.Diagnostics.Process.Start() [/github/workspace/WorkFlow-Notes.csproj]
/var/nuget/microsoft.typescript.msbuild/4.7.3/tools/Microsoft.TypeScript.targets(320,5): error MSB6003:    at Microsoft.Build.Utilities.ToolTask.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [/github/workspace/WorkFlow-Notes.csproj]
/var/nuget/microsoft.typescript.msbuild/4.7.3/tools/Microsoft.TypeScript.targets(320,5): error MSB6003:    at TypeScript.Tasks.VsTsc.ExecuteTool(String pathToTool, String responseFileCommands, String commandLineCommands) [/github/workspace/WorkFlow-Notes.csproj]
/var/nuget/microsoft.typescript.msbuild/4.7.3/tools/Microsoft.TypeScript.targets(320,5): error MSB6003:    at Microsoft.Build.Utilities.ToolTask.Execute() [/github/workspace/WorkFlow-Notes.csproj] | 1 | Please build your app locally before publishing. | https://docs.microsoft.com/en-us/azure/app-service/configure-language-dotnetcore?pivots=platform-linux

---End of Oryx build logs---
Oryx has failed to build the solution.

Most notably, the line An error occurred trying to start process 'node' with working directory '/github/workspace'. No such file or directory [/github/workspace/WorkFlow-Notes.csproj]

Which to me implies that csproj, being in the root directory for the source code, isn't seen when the root of the app itself is located at wwwroot. Otherwise I'm not sure how I could point Oryx toward the csproj location in specific while maintaining wwwroot as the app root.

Link to workflow file: https://github.com/Syni44/workflow-notes/actions/runs/3170861205/workflow Repo: https://github.com/Syni44/workflow-notes VS version: Visual Studio Community 2022

annikel commented 1 year ago

Hi @Syni44, please try updating the _outputlocation in the Build And Deploy step of your workflow file to wwwroot.

Syni44 commented 1 year ago

Unfortunately results in the same error.