Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to .NET 6 #2

Draft
wants to merge 1 commit into
base: devspaces-3-rhel-8
Choose a base branch
from
Draft
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
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Red Hat Inc. and others.
Copyright (c) 2022 Red Hat Inc. and others.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
34 changes: 8 additions & 26 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
/*---------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------
* Copyright (c) Red Hat, Inc. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;

namespace web
{
public class Program
{
public static void Main(string[] args)
{
BuildWebHost(args).Run();
}
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseUrls("http://0.0.0.0:5000/")
.Build();

}
}
app.Urls.Add("http://0.0.0.0:5000/");

app.MapGet("/", () => "Hello World!");

app.Run();
35 changes: 0 additions & 35 deletions Startup.cs

This file was deleted.

11 changes: 2 additions & 9 deletions devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,14 @@ components:
volume:
size: 1G
commands:
- id: 1-update-dependencies
exec:
component: tools
workingDir: ${PROJECTS_ROOT}/dotnet-web-simple
commandLine: "dotnet restore"
group:
kind: build
- id: 2-build
- id: 1-build
exec:
component: tools
workingDir: ${PROJECTS_ROOT}/dotnet-web-simple
commandLine: "dotnet build"
group:
kind: build
- id: 3-run
- id: 2-run
exec:
component: tools
workingDir: ${PROJECTS_ROOT}/dotnet-web-simple
Expand Down
10 changes: 5 additions & 5 deletions web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
* Licensed under the MIT License. See LICENSE in the project root for license information.
************************************************************************************************
-->

<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>web</RootNamespace>
</PropertyGroup>

<ItemGroup>
</ItemGroup>

</Project>