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
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.*
8.0.*
9.0.*
10.0.*
Expand Down
83 changes: 0 additions & 83 deletions Steeltoe.NetCoreToolTemplates.sln

This file was deleted.

18 changes: 18 additions & 0 deletions Steeltoe.NetCoreToolTemplates.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitattributes" />
<File Path=".gitignore" />
<File Path="DEVELOPER.md" />
<File Path="README.md" />
<File Path="src/Content/NetCoreTool.Template.WebApi/CSharp/Directory.Build.props" />
<File Path="test/Directory.Build.props" />
</Folder>
<Folder Name="/src/">
<Project Path="src/Content/NetCoreTool.Template.WebApi/CSharp/Company.WebApplication.CS.csproj" />
</Folder>
<Folder Name="/test/">
<Project Path="test/NetCoreTool.Template.WebApi.Test/Steeltoe.NetCoreTool.Template.WebApi.Test.csproj" />
</Folder>
<Project Path="src/Steeltoe.NetCoreTool.Templates.csproj" />
</Solution>
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
"type": "parameter",
"datatype": "choice",
"choices": [
{
"choice": "net6.0",
"description": "Target net6.0"
},
{
"choice": "net8.0",
"description": "Target net8.0"
Expand All @@ -94,15 +90,6 @@
"defaultValue": "net10.0",
"replaces": "$(FrameworkOption)"
},
"IsFrameworkNet60": {
"type": "generated",
"generator": "regexMatch",
"datatype": "bool",
"parameters": {
"source": "Framework",
"pattern": "^net6\\.0$"
}
},
"IsFrameworkNet80": {
"type": "generated",
"generator": "regexMatch",
Expand Down Expand Up @@ -806,10 +793,6 @@
{
"condition": "(Framework == 'net8.0')",
"value": "6.0.*"
},
{
"condition": "(Framework == 'net6.0')",
"value": "5.2.*"
}
]
}
Expand All @@ -832,10 +815,6 @@
{
"condition": "(Framework == 'net8.0')",
"value": "9.3.*"
},
{
"condition": "(Framework == 'net6.0')",
"value": "9.1.*"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,18 @@
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Condition="'$(IsFrameworkNet90)' == 'True'" Version="9.0.*" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Condition="'$(IsFrameworkNet100)' == 'True'" Version="10.0.*" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Condition="'$(DockerfileOption)' == 'True'" Version="1.23.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Condition="'$(IsFrameworkNet60)' == 'True'" Version="6.5.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Condition="'$(IsFrameworkNet80)' == 'True'" Version="6.6.2" />
</ItemGroup>
<!--#if (HasAnySteeltoe) -->

<ItemGroup>
<PackageReference Include="Microsoft.Azure.Cosmos" Condition="'$(ConnectorCosmosDbOption)' == 'True'" Version="3.57.*" />
<PackageReference Include="Microsoft.Azure.Cosmos" Condition="'$(ConnectorCosmosDbOption)' == 'True'" Version="3.58.*" />
<PackageReference Include="Microsoft.Azure.SpringCloud.Client" Condition="'$(HasHostingAzureSpringCloudInSteeltoeV3)' == 'True'" Version="2.0.0-preview.3" />
<PackageReference Include="Microsoft.Data.SqlClient" Condition="'$(HasConnectorSqlServerWithoutEfCore)' == 'True'" Version="$(SqlClientVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Condition="'$(HasAnyEfCoreConnector)' == 'True'" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Condition="'$(ConnectorSqlServerEfCoreOption)' == 'True'" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Condition="'$(ConnectorRedisOption)' == 'True'" Version="$(AspNetCoreVersion)" />
<PackageReference Include="MongoDB.Driver" Condition="'$(ConnectorMongoDbOption)' == 'True'" Version="3.6.*" />
<PackageReference Include="MongoDB.Driver" Condition="'$(ConnectorMongoDbOption)' == 'True'" Version="3.7.*" />
<PackageReference Include="MySql.Data" Condition="'$(HasConnectorMySqlWithoutEfCore)' == 'True'" Version="$(MySqlVersion)" />
<PackageReference Include="MySql.EntityFrameworkCore" Condition="'$(ConnectorMySqlEfCoreOption)' == 'True'" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Newtonsoft.Json" Condition="'$(ConnectorCosmosDbOption)' == 'True'" Version="13.0.*" />
Expand Down
13 changes: 2 additions & 11 deletions src/Content/NetCoreTool.Template.WebApi/CSharp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

# This stage is used when running from VS in fast mode (Default for Debug configuration)
#if (IsFrameworkNet60)
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
#elif (IsFrameworkNet80)
#if (IsFrameworkNet80)
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
#elif (IsFrameworkNet90)
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
Expand All @@ -14,19 +12,12 @@ FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
USER $APP_UID
#endif
WORKDIR /app
#if (IsFrameworkNet60)
EXPOSE 80
EXPOSE 443
#else
EXPOSE 8080
EXPOSE 8081
#endif


# This stage is used to build the service project
#if (IsFrameworkNet60)
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
#elif (IsFrameworkNet80)
#if (IsFrameworkNet80)
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
#elif (IsFrameworkNet90)
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
Expand Down
15 changes: 2 additions & 13 deletions src/Content/NetCoreTool.Template.WebApi/CSharp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.
#if (IsFrameworkNet60 || IsFrameworkNet80)
#if (IsFrameworkNet80)
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
Expand Down Expand Up @@ -342,7 +342,7 @@
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
#if (IsFrameworkNet60 || IsFrameworkNet80)
#if (IsFrameworkNet80)
app.UseSwagger();
app.UseSwaggerUI();
#elif (IsFrameworkNet90 || IsFrameworkNet100)
Expand All @@ -365,11 +365,7 @@
var forecast = Enumerable.Range(1, 5).Select(index =>
new WeatherForecast
(
#if (IsFrameworkNet60)
DateTime.Now.AddDays(index),
#else
DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
#endif
Random.Shared.Next(-20, 55),
summaries[Random.Shared.Next(summaries.Length)]
))
Expand Down Expand Up @@ -402,14 +398,7 @@
app.Run();
#endif

#if (IsFrameworkNet60)
internal record WeatherForecast(DateTime Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
#else
internal record WeatherForecast(DateOnly Date, int TemperatureC, string? Summary)
{
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
//#if (IsFrameworkNet60 || IsFrameworkNet80)
//#if (IsFrameworkNet80)
"launchBrowser": true,
"launchUrl": "swagger",
//#endif
Expand All @@ -16,7 +16,7 @@
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
//#if (IsFrameworkNet60 || IsFrameworkNet80)
//#if (IsFrameworkNet80)
"launchBrowser": true,
"launchUrl": "swagger",
//#endif
Expand All @@ -28,19 +28,15 @@
},
"Container (Dockerfile)": {
"commandName": "Docker",
//#if (IsFrameworkNet60 || IsFrameworkNet80)
//#if (IsFrameworkNet80)
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
//#else
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
//#endif
"environmentVariables": {
//#if (IsFrameworkNet60)
"ASPNETCORE_URLS": "https://+:443;http://+:80"
//#else
"ASPNETCORE_HTTPS_PORTS": "8081",
"ASPNETCORE_HTTP_PORTS": "8080"
//#endif
},
"publishAllPorts": true,
"useSSL": true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ConnectorCosmosDbOptionTest(ITestOutputHelper logger)
{
protected override void AssertPackageReferencesHook(ProjectOptions options, List<(string, string)> packages)
{
packages.Add(("Microsoft.Azure.Cosmos", "3.57.*"));
packages.Add(("Microsoft.Azure.Cosmos", "3.58.*"));
packages.Add(("Newtonsoft.Json", "13.0.*"));
packages.Add((GetPackageName(options.SteeltoeVersion), "$(SteeltoeVersion)"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ConnectorMongoDbOptionTest(ITestOutputHelper logger)
{
protected override void AssertPackageReferencesHook(ProjectOptions options, List<(string, string)> packages)
{
packages.Add(("MongoDB.Driver", "3.6.*"));
packages.Add(("MongoDB.Driver", "3.7.*"));
packages.Add((GetPackageName(options.SteeltoeVersion), "$(SteeltoeVersion)"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ protected override void AssertPackageReferencesHook(ProjectOptions options, List
{
var mySqlVersion = options.Framework switch
{
Framework.Net60 => "9.1.*",
Framework.Net80 => "9.3.*",
Framework.Net90 => "9.3.*",
Framework.Net100 => "9.6.*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ protected override void AssertPackageReferencesHook(ProjectOptions options, List
{
var sqlClientVersion = options.Framework switch
{
Framework.Net60 => "5.2.*",
Framework.Net80 => "6.0.*",
Framework.Net90 => "6.0.*",
Framework.Net100 => "6.1.*",
Expand Down
10 changes: 3 additions & 7 deletions test/NetCoreTool.Template.WebApi.Test/DefaultsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,7 @@ protected override void AssertPackageReferencesHook(ProjectOptions options, List
{
var openApiVersion = GetPackageVersionForFramework(options.Framework);

if (options.Framework == Framework.Net60)
{
packages.Add(("Swashbuckle.AspNetCore", "6.5.0"));
}
else if (options.Framework == Framework.Net80)
if (options.Framework == Framework.Net80)
{
packages.Add(("Microsoft.AspNetCore.OpenApi", openApiVersion));
packages.Add(("Swashbuckle.AspNetCore", "6.6.2"));
Expand Down Expand Up @@ -132,7 +128,7 @@ private void AssertLaunchSettings(ProjectOptions options, LaunchSettings setting
{
foreach (var profile in settings.Profiles.Values)
{
if (options.Framework is Framework.Net60 or Framework.Net80)
if (options.Framework == Framework.Net80)
{
profile.LaunchBrowser.Should().BeTrue();
profile.LaunchUrl.Should().Be("swagger");
Expand All @@ -149,7 +145,7 @@ private void AssertLaunchSettings(ProjectOptions options, LaunchSettings setting

protected override void AssertProgramSnippetsHook(ProjectOptions options, List<string> snippets)
{
if (options.Framework is Framework.Net60 or Framework.Net80)
if (options.Framework == Framework.Net80)
{
snippets.Add("// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle");
snippets.Add("builder.Services.AddEndpointsApiExplorer();");
Expand Down
Loading
Loading