Error in asp.net core 2.1 project to swagger
See original GitHub issueSystem.InvalidOperationException: Swagger generation failed with non-zero exit code ‘1’.
Runtime: NetCore21 at NSwag.Commands.SwaggerGeneration.AspNetCore.AspNetCoreToSwaggerCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\SwaggerGeneration\AspNetCore\AspNetCoreToSwaggerCommand.cs:line 172 at NSwag.Commands.NSwagDocumentBase.GenerateSwaggerDocumentAsync() in C:\projects\nswag\src\NSwag.Commands\NSwagDocumentBase.cs:line 268 at NSwag.Commands.NSwagDocument.ExecuteAsync() in C:\projects\nswag\src\NSwag.Commands\NSwagDocument.cs:line 81 at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 77 at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in C:\projects\nswag\src\NSwag.Commands\Commands\Document\ExecuteDocumentCommand.cs:line 31 at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input) at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input) at NConsole.CommandLineProcessor.Process(String[] args, Object input) at NSwag.Commands.NSwagCommandProcessor.Process(String[] args) in C:\projects\nswag\src\NSwag.Commands\NSwagCommandProcessor.cs:line 54
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly ‘NSwag.CodeGeneration, Version=11.17.15.0, Culture=neutral, PublicKeyToken=c2d88086e098d109’. The system cannot find the file specified.
Could not load file or assembly ‘NSwag.CodeGeneration.CSharp, Version=11.17.15.0, Culture=neutral, PublicKeyToken=c2d88086e098d109’. The system cannot find the file specified.
Could not load file or assembly ‘NSwag.CodeGeneration, Version=11.17.15.0, Culture=neutral, PublicKeyToken=c2d88086e098d109’. The system cannot find the file specified.
Could not load file or assembly ‘NSwag.CodeGeneration.CSharp, Version=11.17.15.0, Culture=neutral, PublicKeyToken=c2d88086e098d109’. The system cannot find the file specified.
Could not load file or assembly ‘NSwag.CodeGeneration.TypeScript, Version=11.17.15.0, Culture=neutral, PublicKeyToken=c2d88086e098d109’. The system cannot find the file specified.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at System.Linq.Enumerable.SelectManySingleSelectorIterator2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)
at AutoMapper.ServiceCollectionExtensions.AddAutoMapperClasses(IServiceCollection services, Action1 additionalInitAction, IEnumerable
1 assembliesToScan)
at Mizekar.Micro.Idea.Startup.ConfigureServices(IServiceCollection services) in D:\Workspace\Mizekar.Micro.Idea\src\Mizekar.Micro.Idea\Startup.cs:line 46
— End of stack trace from previous location where exception was thrown —
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.Initialize()
at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build()
at NSwag.Commands.SwaggerGeneration.AspNetCore.AspNetCoreToSwaggerGeneratorCommandEntryPoint.GetServiceProvider(String applicationName) in C:\projects\nswag\src\NSwag.Commands\Commands\SwaggerGeneration\AspNetCore\AspNetCoreToSwaggerGeneratorCommandEntryPoint.cs:line 64
at NSwag.Commands.SwaggerGeneration.AspNetCore.AspNetCoreToSwaggerGeneratorCommandEntryPoint.Process(String commandContent, String outputFile, String applicationName) in C:\projects\nswag\src\NSwag.Commands\Commands\SwaggerGeneration\AspNetCore\AspNetCoreToSwaggerGeneratorCommandEntryPoint.cs:line 21
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at NSwag.AspNetCore.Launcher.Program.Main(String[] args) in C:\projects\nswag\src\NSwag.AspNetCore.Launcher\Program.cs:line 125
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (5 by maintainers)
Please create a new issue to add this setting (default: nswag.json directory)
Good to know, but still bothers me that this is required…