Is Github Workflow Action support C# DotNet Now? (Not .NET Core, I'm asking .NET) #26932
-
Is Github Workflow Action support C# DotNet Now? (Not .NET Core, I’m asking .NET) Is this file work on .NET (not .NET Core)? https://github.com/actions/starter-workflows/blob/master/ci/dotnet-core.yml |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @yang09701194 , Github actions supports any languages including C# DotNet. The file (dotnet-core.yaml) refered is a dotnet core workflow yaml file sample. If you’d like to build .Net project, you can directly call ‘msbuild.exe’ which is installed on github hosted runner already, code sample as below:
Or use below actions 'warrenbuckley/Setup-MSBuild’:
Hope it helps! |
Beta Was this translation helpful? Give feedback.
-
Thank you, it works! Add some description of my try for anyone new to this, the GITHUB_WORKSPACE of $Env is seen as repostiroy root, so suppose my Id is Yang09701194 , the repository name is YangTestWorkflowAction , the sln file relative path is Yang09701194/YangTestWorkflowAction/ConsoleApplication1/ConsoleApplication1.sln then write $Env:GITHUB_WORKSPACE\ConsoleApplication1\ConsoleApplication1.sln works. I have created an Example: Build Succcess: https://github.com/Yang09701194/YangTestWorkflowAction/actions/runs/55459054 Workflow file: https://github.com/Yang09701194/YangTestWorkflowAction/actions/runs/55459054/workflow |
Beta Was this translation helpful? Give feedback.
-
is there a way to use MSBuild version 12 in github actions? tried using this in the workflow steps run: | .\msbuild.exe but it says it is not found in this location? |
Beta Was this translation helpful? Give feedback.
Hi @yang09701194 ,
Github actions supports any languages including C# DotNet. The file (dotnet-core.yaml) refered is a dotnet core workflow yaml file sample.
If you’d like to build .Net project, you can directly call ‘msbuild.exe’ which is installed on github hosted runner already, code sample as below:
Or use below actions 'warrenbuckley/Setup-MSBuild’: