Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build with MSBuild

on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: windows-latest
permissions:
contents: read

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Restore and build solution with MSBuild
run: msbuild HelloWorld.sln /t:Restore,Build /p:Configuration=Release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
**/bin/
**/obj/
39 changes: 39 additions & 0 deletions HelloWorld.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "src\HelloWorld\HelloWorld.csproj", "{44691A85-F760-4C30-99B5-BC0BE9799919}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{44691A85-F760-4C30-99B5-BC0BE9799919}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Debug|x64.ActiveCfg = Debug|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Debug|x64.Build.0 = Debug|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Debug|x86.ActiveCfg = Debug|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Debug|x86.Build.0 = Debug|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Release|Any CPU.Build.0 = Release|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Release|x64.ActiveCfg = Release|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Release|x64.Build.0 = Release|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Release|x86.ActiveCfg = Release|Any CPU
{44691A85-F760-4C30-99B5-BC0BE9799919}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{44691A85-F760-4C30-99B5-BC0BE9799919} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
EndGlobalSection
EndGlobal
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# test-msbuild
# test-msbuild

Sample C# "Hello, World!" console app built with MSBuild.

## Build with MSBuild

```bash
dotnet msbuild HelloWorld.sln /t:Restore,Build /p:Configuration=Release
```

## Run locally

```bash
dotnet run --project src/HelloWorld/HelloWorld.csproj
```
10 changes: 10 additions & 0 deletions src/HelloWorld/HelloWorld.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions src/HelloWorld/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.WriteLine("Hello, World!");
Loading