Skip to content
Permalink
Browse files

Add .NET Core 3.0 support (#2041)

* Add .NET Core 3.0 support in NSwag.AspNetCore

* Fix referenced version

* Add TFs

* Regenerate clients

* Update exception
  • Loading branch information...
RicoSuter committed Sep 26, 2019
1 parent cb326ca commit 93f0970c5b631b9646cf7ce8053ec28ce8ff13e7
Showing with 476 additions and 139 deletions.
  1. +1 −0 build/01_Build.bat
  2. +6 −0 build/03_RunIntegrationTests.bat
  3. +1 −1 samples/WithoutMiddleware/Sample.AspNetCore20/nswag_project_swagger.json
  4. +1 −1 samples/WithoutMiddleware/Sample.AspNetCore21/nswag_assembly_swagger.json
  5. +1 −1 samples/WithoutMiddleware/Sample.AspNetCore21/nswag_project_swagger.json
  6. +1 −1 samples/WithoutMiddleware/Sample.AspNetCore21/nswag_reflection_swagger.json
  7. +9 −2 src/NSwag.AspNetCore/NSwag.AspNetCore.csproj
  8. +5 −0 src/NSwag.AspNetCore/global.json
  9. +10 −9 src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs
  10. +30 −11 src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs
  11. +23 −9 src/NSwag.Commands/Commands/Generation/OpenApiGeneratorCommandBase.cs
  12. +2 −1 src/NSwag.Commands/Commands/Generation/WebApi/WebApiToOpenApiCommand.cs
  13. +7 −1 src/NSwag.Commands/NSwag.Commands.csproj
  14. +4 −0 src/NSwag.Commands/NSwagDocument.cs
  15. +3 −0 src/NSwag.Commands/Runtime.cs
  16. +5 −1 src/NSwag.Commands/RuntimeUtilities.cs
  17. +5 −1 src/NSwag.ConsoleCore/NSwag.ConsoleCore.csproj
  18. +4 −0 src/NSwag.Generation.AspNetCore/AspNetCoreOpenApiDocumentGenerator.cs
  19. +9 −2 src/NSwag.Generation.AspNetCore/NSwag.Generation.AspNetCore.csproj
  20. +6 −6 src/NSwag.Integration.ClientPCL/PetStoreClient.cs
  21. +4 −4 src/NSwag.Integration.ClientPCL/ServiceClients.cs
  22. +8 −8 src/NSwag.Integration.ClientPCL/ServiceClientsContracts.cs
  23. +4 −4 src/NSwag.Integration.ClientPCL/UberClient.cs
  24. +1 −1 src/NSwag.Integration.ClientPCL/swagger.json
  25. +7 −7 src/NSwag.Integration.Console/Controllers.cs
  26. +4 −4 src/NSwag.Integration.Console/ServiceClients.cs
  27. +4 −4 src/NSwag.Integration.Console/ServiceClientsContracts.cs
  28. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngular.ts
  29. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAngularJS.ts
  30. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsAurelia.ts
  31. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsFetch.ts
  32. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryCallbacks.ts
  33. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromises.ts
  34. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsJQueryPromisesKO.ts
  35. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsPetStoreFetch.ts
  36. +1 −1 src/NSwag.Integration.TypeScriptWeb/scripts/serviceClientsUberFetch.ts
  37. +1 −0 src/NSwag.MSBuild/NSwag.MSBuild.nuspec
  38. +2 −1 src/NSwag.MSBuild/NSwag.MSBuild.props
  39. +21 −0 src/NSwag.Min.sln
  40. +4 −0 src/NSwag.Npm/README.md
  41. +2 −1 src/NSwag.Npm/bin/nswag.js
  42. +1 −1 src/NSwag.Sample.NETCore11/swagger.json
  43. +1 −1 src/NSwag.Sample.NETCore20/swagger.json
  44. +1 −1 src/NSwag.Sample.NETCore21/swagger_assembly_cli.json
  45. +1 −1 src/NSwag.Sample.NETCore21/swagger_project_cli.json
  46. +1 −1 src/NSwag.Sample.NETCore22/openapi_project_cli.json
  47. +1 −1 src/NSwag.Sample.NETCore22/swagger_assembly_cli.json
  48. +1 −1 src/NSwag.Sample.NETCore22/swagger_project_cli.json
  49. +2 −2 src/NSwag.Sample.NETCore30/NSwag.Sample.NETCore30.csproj
  50. +7 −20 src/NSwag.Sample.NETCore30/Startup.cs
  51. +58 −0 src/NSwag.Sample.NETCore30/nswag.json
  52. +147 −0 src/NSwag.Sample.NETCore30/openapi.json
  53. +1 −1 src/NSwag.Sample.NetGlobalAsax/swagger.json
  54. +21 −0 src/NSwag.sln
  55. +24 −19 src/NSwagStudio.Installer/NSwagStudio.Installer.wixproj
  56. +5 −0 src/NSwagStudio/nswag.cmd
@@ -16,6 +16,7 @@ xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp1.1/publish" "%~dp0/
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp2.0/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore20" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp2.1/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore21" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp2.2/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore22" /E /I /y
xcopy "%~dp0/../src/NSwag.ConsoleCore/bin/release/netcoreapp3.0/publish" "%~dp0/../src/NSwag.Npm/bin/binaries/NetCore30" /E /I /y

REM Package nuspecs
"%~dp0/nuget.exe" pack "%~dp0/../src/NSwag.MSBuild/NSwag.MSBuild.nuspec" || goto :error
@@ -31,6 +31,12 @@ dotnet build /p:CopyLocalLockFileAssemblies=true || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore22 || goto :error
popd

pushd "%~dp0\..\src\NSwag.Sample.NETCore30"
dotnet restore || goto :error
dotnet build /p:CopyLocalLockFileAssemblies=true || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:NetCore30 || goto :error
popd

pushd "%~dp0\..\src\NSwag.Sample.NetGlobalAsax"
msbuild || goto :error
cmd /c call "..\NSwagStudio\bin\Release\nswag.cmd" run /runtime:Winx64 || goto :error
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v13.0.5.0 (NJsonSchema v10.0.23.0 (Newtonsoft.Json v10.0.0.0))",
"x-generator": "NSwag v13.0.6.0 (NJsonSchema v10.0.23.0 (Newtonsoft.Json v10.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v13.0.5.0 (NJsonSchema v10.0.23.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v13.0.6.0 (NJsonSchema v10.0.23.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v13.0.5.0 (NJsonSchema v10.0.23.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v13.0.6.0 (NJsonSchema v10.0.23.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
@@ -1,5 +1,5 @@
{
"x-generator": "NSwag v13.0.5.0 (NJsonSchema v10.0.23.0 (Newtonsoft.Json v11.0.0.0))",
"x-generator": "NSwag v13.0.6.0 (NJsonSchema v10.0.23.0 (Newtonsoft.Json v11.0.0.0))",
"swagger": "2.0",
"info": {
"title": "My Title",
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net451;netstandard1.6;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net451;netstandard1.6;netstandard2.0;netcoreapp3.0</TargetFrameworks>
<Description>NSwag: The OpenAPI/Swagger API toolchain for .NET and TypeScript</Description>
<Version>13.0.6</Version>
<PackageTags>Swagger Documentation AspNetCore NetCore TypeScript CodeGen</PackageTags>
@@ -35,19 +35,26 @@
<EmbeddedResource Include="SwaggerUi\**\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**;@(EmbeddedResource)" />
<EmbeddedResource Include="SwaggerUi3\**\*" Exclude="bin\**;obj\**;**\*.xproj;packages\**;@(EmbeddedResource)" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp3.0' ">
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="$(MicrosoftAspNetCoreMvcCorePackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="$(MicrosoftAspNetCoreMvcFormattersJsonPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(MicrosoftAspNetCoreStaticFilesPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="$(MicrosoftExtensionsFileProvidersEmbeddedPackageVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
<!--<PackageReference Include="Microsoft.AspNetCore.App" Version="3.0.0" />-->
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' OR '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.IO.FileSystem" Version="$(SystemIOFileSystemPackageVersion)" />
<PackageReference Include="System.Xml.XPath.XDocument" Version="$(SystemXmlXPathXDocumentPackageVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
<Compile Remove="Middlewares\WebApiToSwaggerMiddleware.cs" />
<Compile Remove="SwaggerExtensions.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NSwag.Annotations\NSwag.Annotations.csproj" />
<ProjectReference Include="..\NSwag.Core\NSwag.Core.csproj" />
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "3.0.100-preview3-010431"
}
}
@@ -23,6 +23,7 @@
using Microsoft.AspNetCore.Hosting;
using NSwag.Generation;
using NJsonSchema.Generation;
using Namotion.Reflection;

#if NETCOREAPP || NETSTANDARD
using System.Runtime.Loader;
@@ -266,35 +267,35 @@ internal string ChangeWorkingDirectoryAndSetAspNetCoreEnvironment()
return currentWorkingDirectory;
}

public async Task<OpenApiDocument> GenerateDocumentAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IWebHost host, string currentWorkingDirectory)
public async Task<OpenApiDocument> GenerateDocumentAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IServiceProvider serviceProvider, string currentWorkingDirectory)
{
Directory.SetCurrentDirectory(currentWorkingDirectory);

if (UseDocumentProvider)
{
return await GenerateDocumentWithDocumentProviderAsync(host);
return await GenerateDocumentWithDocumentProviderAsync(serviceProvider);
}
else
{
return await GenerateDocumentWithApiDescriptionAsync(assemblyLoader, host, currentWorkingDirectory);
return await GenerateDocumentWithApiDescriptionAsync(assemblyLoader, serviceProvider, currentWorkingDirectory);
}
}

private async Task<OpenApiDocument> GenerateDocumentWithDocumentProviderAsync(IWebHost host)
private async Task<OpenApiDocument> GenerateDocumentWithDocumentProviderAsync(IServiceProvider serviceProvider)
{
var documentGenerator = host.Services.GetRequiredService<IOpenApiDocumentGenerator>();
var documentGenerator = serviceProvider.GetRequiredService<IOpenApiDocumentGenerator>();
var document = await documentGenerator.GenerateAsync(DocumentName);
return document;
}

private async Task<OpenApiDocument> GenerateDocumentWithApiDescriptionAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IWebHost host, string currentWorkingDirectory)
private async Task<OpenApiDocument> GenerateDocumentWithApiDescriptionAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IServiceProvider serviceProvider, string currentWorkingDirectory)
{
InitializeCustomTypes(assemblyLoader);

// In the case of KeyNotFoundException, see https://github.com/aspnet/Mvc/issues/5690
var apiDescriptionProvider = host.Services.GetRequiredService<IApiDescriptionGroupCollectionProvider>();
var apiDescriptionProvider = serviceProvider.GetRequiredService<IApiDescriptionGroupCollectionProvider>();

var settings = await CreateSettingsAsync(assemblyLoader, host, currentWorkingDirectory);
var settings = await CreateSettingsAsync(assemblyLoader, serviceProvider, currentWorkingDirectory);
var generator = new AspNetCoreOpenApiDocumentGenerator(settings);
var document = await generator.GenerateAsync(apiDescriptionProvider.ApiDescriptionGroups).ConfigureAwait(false);

@@ -308,7 +309,7 @@ protected override async Task<string> RunIsolatedAsync(AssemblyLoader.AssemblyLo
var currentWorkingDirectory = ChangeWorkingDirectoryAndSetAspNetCoreEnvironment();
using (var webHost = await CreateWebHostAsync(assemblyLoader))
{
var document = await GenerateDocumentAsync(assemblyLoader, webHost, currentWorkingDirectory);
var document = await GenerateDocumentAsync(assemblyLoader, webHost.TryGetPropertyValue<IServiceProvider>("Services"), currentWorkingDirectory);
return UseDocumentProvider ? document.ToJson() : document.ToJson(OutputType);
}
}
@@ -23,11 +23,11 @@ public static void Process(string commandContent, string outputFile, string appl
var command = JsonConvert.DeserializeObject<AspNetCoreToSwaggerCommand>(commandContent);

var previousWorkingDirectory = command.ChangeWorkingDirectoryAndSetAspNetCoreEnvironment();
var webHost = GetWebHost(applicationName);
var serviceProvider = GetServiceProvider(applicationName);

var assemblyLoader = new AssemblyLoader.AssemblyLoader();
var document = Task.Run(async () =>
await command.GenerateDocumentAsync(assemblyLoader, webHost, previousWorkingDirectory)).GetAwaiter().GetResult();
await command.GenerateDocumentAsync(assemblyLoader, serviceProvider, previousWorkingDirectory)).GetAwaiter().GetResult();

var json = command.UseDocumentProvider ? document.ToJson() : document.ToJson(command.OutputType);

@@ -36,7 +36,7 @@ public static void Process(string commandContent, string outputFile, string appl
File.WriteAllText(outputFile, json);
}

private static IWebHost GetWebHost(string applicationName)
private static IServiceProvider GetServiceProvider(string applicationName)
{
var assemblyName = new AssemblyName(applicationName);
var assembly = Assembly.Load(assemblyName);
@@ -50,29 +50,48 @@ private static IWebHost GetWebHost(string applicationName)
var buildWebHostMethod = entryPointType.GetMethod("BuildWebHost");
var args = new string[0];

IWebHost webHost = null;
IServiceProvider serviceProvider = null;
if (buildWebHostMethod != null)
{
var result = buildWebHostMethod.Invoke(null, new object[] { args });
webHost = (IWebHost)result;
serviceProvider = ((IWebHost)result).Services;
}
else
{
var createWebHostMethod = entryPointType?.GetMethod("CreateWebHostBuilder");
var createWebHostMethod =
entryPointType?.GetRuntimeMethod("CreateWebHostBuilder", new[] { typeof(string[]) }) ??
entryPointType?.GetRuntimeMethod("CreateWebHostBuilder", new Type[0]);

if (createWebHostMethod != null)
{
var webHostBuilder = (IWebHostBuilder)createWebHostMethod.Invoke(null, new object[] { args });
webHost = webHostBuilder.Build();
var webHostBuilder = (IWebHostBuilder)createWebHostMethod.Invoke(
null, createWebHostMethod.GetParameters().Length > 0 ? new object[] { args } : new object[0]);
serviceProvider = webHostBuilder.Build().Services;
}
#if NETCOREAPP3_0
else
{
var createHostMethod =
entryPointType?.GetRuntimeMethod("CreateHostBuilder", new[] { typeof(string[]) }) ??
entryPointType?.GetRuntimeMethod("CreateHostBuilder", new Type[0]);

if (createHostMethod != null)
{
var webHostBuilder = (Microsoft.Extensions.Hosting.IHostBuilder)createHostMethod.Invoke(
null, createHostMethod.GetParameters().Length > 0 ? new object[] { args } : new object[0]);
serviceProvider = webHostBuilder.Build().Services;
}
}
#endif
}

if (webHost != null)
if (serviceProvider != null)
{
return webHost;
return serviceProvider;
}

throw new InvalidOperationException($"aspnet2swaggercommand requires the entry point type {entryPointType.FullName} to have " +
$"either an BuildWebHost or CreateWebHostBuilder method. " +
$"either an BuildWebHost or CreateWebHostBuilder/CreateHostBuilder method. " +
$"See https://docs.microsoft.com/en-us/aspnet/core/fundamentals/hosting?tabs=aspnetcore2x " +
$"for suggestions on ways to refactor your startup type.");
}
@@ -216,10 +216,14 @@ public bool AllowNullableBodyParameters
set => Settings.AllowNullableBodyParameters = value;
}

public async Task<TSettings> CreateSettingsAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IWebHost webHost, string workingDirectory)
public async Task<TSettings> CreateSettingsAsync(AssemblyLoader.AssemblyLoader assemblyLoader, IServiceProvider serviceProvider, string workingDirectory)
{
var mvcOptions = webHost?.Services?.GetRequiredService<IOptions<MvcOptions>>().Value;
var mvcJsonOptions = webHost?.Services?.GetRequiredService<IOptions<MvcJsonOptions>>();
var mvcOptions = serviceProvider?.GetRequiredService<IOptions<MvcOptions>>().Value;
#if NETCOREAPP3_0
var mvcJsonOptions = serviceProvider?.GetRequiredService<IOptions<MvcNewtonsoftJsonOptions>>();
#else
var mvcJsonOptions = serviceProvider?.GetRequiredService<IOptions<MvcJsonOptions>>();
#endif
var serializerSettings = mvcJsonOptions?.Value?.SerializerSettings;

Settings.ApplySettings(serializerSettings, mvcOptions);
@@ -230,7 +234,7 @@ public async Task<TSettings> CreateSettingsAsync(AssemblyLoader.AssemblyLoader a
return Settings;
}

protected async Task<IWebHost> CreateWebHostAsync(AssemblyLoader.AssemblyLoader assemblyLoader)
protected async Task<IDisposable> CreateWebHostAsync(AssemblyLoader.AssemblyLoader assemblyLoader)
{
if (!string.IsNullOrEmpty(CreateWebHostBuilderMethod))
{
@@ -282,21 +286,31 @@ protected async Task<IWebHost> CreateWebHostAsync(AssemblyLoader.AssemblyLoader
var programType = firstAssembly.ExportedTypes.First(t => t.Name == "Program") ??
throw new InvalidOperationException("The Program class could not be determined in the assembly '" + firstAssembly.FullName + "'.");

var method = programType.GetRuntimeMethod("CreateWebHostBuilder", new[] { typeof(string[]) });
var method =
programType.GetRuntimeMethod("CreateWebHostBuilder", new[] { typeof(string[]) }) ??
programType.GetRuntimeMethod("CreateWebHostBuilder", new Type[0]);

if (method != null)
{
return ((IWebHostBuilder)method.Invoke(null, new object[] { new string[0] })).Build();
return ((IWebHostBuilder)method.Invoke(
null, method.GetParameters().Length > 0 ? new object[] { new string[0] } : new object[0])).Build();
}
else
{
method = programType.GetRuntimeMethod("CreateWebHostBuilder", new Type[0]);
#if NETCOREAPP3_0
method =
programType.GetRuntimeMethod("CreateHostBuilder", new[] { typeof(string[]) }) ??
programType.GetRuntimeMethod("CreateHostBuilder", new Type[0]);

if (method != null)
{
return ((IWebHostBuilder)method.Invoke(null, new object[0])).Build();
return ((Microsoft.Extensions.Hosting.IHostBuilder)method.Invoke(
null, method.GetParameters().Length > 0 ? new object[] { new string[0] } : new object[0])).Build();
}
else
#endif
{
throw new InvalidOperationException("The Program class '" + programType.FullName + "' does not have a CreateWebHostBuilder() method.");
throw new InvalidOperationException("The Program class '" + programType.FullName + "' does not have a CreateWebHostBuilder()/CreateHostBuilder() method.");
}
}
}
@@ -13,6 +13,7 @@
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Namotion.Reflection;
using NConsole;
using Newtonsoft.Json;
using NJsonSchema.Infrastructure;
@@ -96,7 +97,7 @@ protected override async Task<string> RunIsolatedAsync(AssemblyLoader.AssemblyLo
{
using (var webHost = await CreateWebHostAsync(assemblyLoader))
{
settings = await CreateSettingsAsync(assemblyLoader, webHost, workingDirectory);
settings = await CreateSettingsAsync(assemblyLoader, webHost.TryGetPropertyValue<IServiceProvider>("Services"), workingDirectory);
}
}
else
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;netcoreapp2.0;netcoreapp2.1;netcoreapp2.2;netcoreapp3.0;net461</TargetFrameworks>
<Description>NSwag: The OpenAPI/Swagger API toolchain for .NET and TypeScript</Description>
<Version>13.0.6</Version>
<PackageTags>OpenAPI Swagger AspNetCore Documentation CodeGen TypeScript WebApi AspNet</PackageTags>
@@ -58,6 +58,12 @@
<PackageReference Include="Microsoft.AspNetCore.Mvc.ApiExplorer" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.2.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.0'">
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<!--<PackageReference Include="Microsoft.AspNetCore.All" Version="3.0.0" />-->
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
@@ -324,6 +324,10 @@ private string GetArgumentsPrefix()
{
return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "NetCore22/dotnet-nswag.dll") + "\" ";
}
else if (runtime == Runtime.NetCore30)
{
return "\"" + System.IO.Path.Combine(RootBinaryDirectory, "NetCore30/dotnet-nswag.dll") + "\" ";
}
else
#endif
return "";
@@ -35,6 +35,9 @@ public enum Runtime
/// <summary>.NET Core 2.2 app.</summary>
NetCore22,

/// <summary>.NET Core 3.0 app.</summary>
NetCore30,

/// <summary>Execute in the same proces.</summary>
Debug
}

0 comments on commit 93f0970

Please sign in to comment.
You can’t perform that action at this time.