Error building Web: System.InvalidOperationException: Swagger generation failed with non-zero exit code '1 #1045
Unanswered
MarcAtSurf
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I downloaded the source code (folder src) and tried to build it in VS 2022 preview. I only changed the NuGet package for Azure.Identy because the version in the solution has a vulnerability.
I can build Application, Domain and Infrastructure, but I can't build Web. I get the following error:
Severity Code Description Project File Line Suppression State
Error NSwag command line tool for .NET Core Net70, toolchain v13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.0.0));Visit http://NSwag.org for more information.;NSwag bin directory: C:\Users\volge001.nuget\packages\nswag.msbuild\13.19.0\tools\Net70;Executing file 'config.nswag' with variables 'Configuration=Debug'...;Launcher directory: C:\Users\volge001.nuget\packages\nswag.msbuild\13.19.0\tools\Net70;System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.;---> System.TypeLoadException: Could not load type 'Microsoft.AspNetCore.Identity.UI.Services.IEmailSender' from assembly 'Microsoft.Extensions.Identity.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.;at Microsoft.AspNetCore.Identity.IdentityBuilderUIExtensions.AddDefaultUI(IdentityBuilder builder);at Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionUIExtensions.AddDefaultIdentity[TUser](IServiceCollection services, Action
1 configureOptions);at Microsoft.Extensions.DependencyInjection.IdentityServiceCollectionUIExtensions.AddDefaultIdentity[TUser](IServiceCollection services);at Microsoft.Extensions.DependencyInjection.DependencyInjection.AddInfrastructureServices(IServiceCollection services, IConfiguration configuration) in C:\Users\volge001\source\repos\CleanArchitecture-main\src\Infrastructure\DependencyInjection.cs:line 51;at Program.<Main>$(String[] args) in C:\Users\volge001\source\repos\CleanArchitecture-main\src\Web\Program.cs:line 9;at Program.<Main>(String[] args);at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor);at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span
1 copyOfArgs, BindingFlags invokeAttr);--- End of stack trace from previous location ---;at Microsoft.Extensions.Hosting.HostFactoryResolver.HostingListener.CreateHost() in //src/NSwag.Commands/HostFactoryResolver.cs:line 271;at Microsoft.Extensions.Hosting.HostFactoryResolver.<>c__DisplayClass8_0.b__0(String[] args) in //src/NSwag.Commands/HostFactoryResolver.cs:line 75;at NSwag.Commands.ServiceProviderResolver.GetServiceProviderWithHostFactoryResolver(Assembly assembly) in //src/NSwag.Commands/HostApplication.cs:line 146;at NSwag.Commands.ServiceProviderResolver.GetServiceProvider(Assembly assembly) in //src/NSwag.Commands/HostApplication.cs:line 70;at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiGeneratorCommandEntryPoint.Process(String commandContent, String outputFile, String applicationName) in //src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs:line 27;at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor);at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span1 copyOfArgs, BindingFlags invokeAttr);--- End of inner exception stack trace ---;at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span
1 copyOfArgs, BindingFlags invokeAttr);at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture);at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters);at NSwag.AspNetCore.Launcher.Program.Main(String[] args) in //src/NSwag.AspNetCore.Launcher/Program.cs:line 132;System.InvalidOperationException: Swagger generation failed with non-zero exit code '1'.;at NSwag.Commands.Generation.AspNetCore.AspNetCoreToSwaggerCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in //src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs:line 231;at NSwag.Commands.NSwagDocumentBase.GenerateSwaggerDocumentAsync() in //src/NSwag.Commands/NSwagDocumentBase.cs:line 275;at NSwag.Commands.NSwagDocument.ExecuteAsync() in //src/NSwag.Commands/NSwagDocument.cs:line 81;at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in //src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 85;at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in //src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 32;at NConsole.CommandLineProcessor.ProcessSingleAsync(String[] args, Object input);at NConsole.CommandLineProcessor.ProcessAsync(String[] args, Object input);at NSwag.Commands.NSwagCommandProcessor.ProcessAsync(String[] args) in //src/NSwag.Commands/NSwagCommandProcessor.cs:line 61 Web C:\Users\volge001\source\repos\CleanArchitecture-main\src\Web\Web.csproj 73Of course I tried Google. The solution I found was to install NSwag.CodeGeneration.CSharp, which I did. Unfortunately this didn't help. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions