You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to generate client code from a .net 9.0 .net core project, I get this error message :
I have only added a the path to my csproj file in the 'Project file path' field in the GUI.
It seems the problem is this line
The static resources manifest file 'C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\bin\Debug\net9.0\NSwag.AspNetCore.Launcher.staticwebassets.endpoints.json' was not found.
Runtime: Net90
at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in //src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs:line 192
at NSwag.Commands.NSwagDocumentBase.GenerateSwaggerDocumentAsync() in //src/NSwag.Commands/NSwagDocumentBase.cs:line 266
at NSwag.Commands.NSwagDocument.ExecuteAsync() in //src/NSwag.Commands/NSwagDocument.cs:line 63
at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in //src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 72
at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in //src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 29
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
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.AggregateException: One or more errors occurred. (The static resources manifest file 'C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\bin\Debug\net9.0\NSwag.AspNetCore.Launcher.staticwebassets.endpoints.json' was not found.)
---> System.InvalidOperationException: The static resources manifest file 'C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\bin\Debug\net9.0\NSwag.AspNetCore.Launcher.staticwebassets.endpoints.json' was not found.
at Microsoft.AspNetCore.Builder.StaticAssetsEndpointRouteBuilderExtensions.ResolveManifest(String manifestPath)
at Microsoft.AspNetCore.Builder.StaticAssetsEndpointRouteBuilderExtensions.MapStaticAssetsCore(IEndpointRouteBuilder endpoints, String manifestPath)
at Microsoft.AspNetCore.Builder.StaticAssetsEndpointRouteBuilderExtensions.MapStaticAssets(IEndpointRouteBuilder endpoints, String staticAssetsManifestPath)
at Program.
$(String[] args) in C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\Program.cs:line 62
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.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at NSwag.Commands.ServiceProviderResolver.GetServiceProviderWithHostFactoryResolver(Assembly assembly) in /_/src/NSwag.Commands/HostApplication.cs:line 165 at NSwag.Commands.ServiceProviderResolver.GetServiceProvider(Assembly assembly) in /_/src/NSwag.Commands/HostApplication.cs:line 66 at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiGeneratorCommandEntryPoint.Process(String commandContent, String outputFile, String applicationName) in /_/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs:line 26 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.RuntimeMethodInfo.Invoke(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 129
Any help is apprishiated.
Regards
The text was updated successfully, but these errors were encountered:
I had the same issue, which seems to be caused by MapStaticAssets() when NSwag.MSBuild runs the project, I fixed it by replacing it with:
if (app.Environment.IsDevelopment())
{
var assemblyTitle = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyTitleAttribute>()?.Title;
if (assemblyTitle is not null)
{
app.MapStaticAssets($"{assemblyTitle}.staticwebassets.endpoints.json");
}
}
else
{
app.MapStaticAssets();
}
Uh oh!
There was an error while loading. Please reload this page.
Hi
Trying to generate client code from a .net 9.0 .net core project, I get this error message :
I have only added a the path to my csproj file in the 'Project file path' field in the GUI.
It seems the problem is this line
The static resources manifest file 'C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\bin\Debug\net9.0\NSwag.AspNetCore.Launcher.staticwebassets.endpoints.json' was not found.
In my bin folder the following file exist
'C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\bin\Debug\net9.0\TDS.GEO.staticwebassets.endpoints.json'
So how can I get it to use my json file, not to use the prefix NSwag.AspNetCore.Launcher ?
Below is the complete error message.
Launcher directory: C:\Program Files (x86)\Rico Suter\NSwagStudio\Net90
System.InvalidOperationException: Swagger generation failed with non-zero exit code '1'.
Runtime: Net90
at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in //src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiCommand.cs:line 192
at NSwag.Commands.NSwagDocumentBase.GenerateSwaggerDocumentAsync() in //src/NSwag.Commands/NSwagDocumentBase.cs:line 266
at NSwag.Commands.NSwagDocument.ExecuteAsync() in //src/NSwag.Commands/NSwagDocument.cs:line 63
at NSwag.Commands.Document.ExecuteDocumentCommand.ExecuteDocumentAsync(IConsoleHost host, String filePath) in //src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 72
at NSwag.Commands.Document.ExecuteDocumentCommand.RunAsync(CommandLineProcessor processor, IConsoleHost host) in //src/NSwag.Commands/Commands/Document/ExecuteDocumentCommand.cs:line 29
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
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
$(String[] args) in C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\Program.cs:line 62---> System.AggregateException: One or more errors occurred. (The static resources manifest file 'C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\bin\Debug\net9.0\NSwag.AspNetCore.Launcher.staticwebassets.endpoints.json' was not found.)
---> System.InvalidOperationException: The static resources manifest file 'C:\TDS\LAN.NET Core\TDS.GEO\TDS.GEO\bin\Debug\net9.0\NSwag.AspNetCore.Launcher.staticwebassets.endpoints.json' was not found.
at Microsoft.AspNetCore.Builder.StaticAssetsEndpointRouteBuilderExtensions.ResolveManifest(String manifestPath)
at Microsoft.AspNetCore.Builder.StaticAssetsEndpointRouteBuilderExtensions.MapStaticAssetsCore(IEndpointRouteBuilder endpoints, String manifestPath)
at Microsoft.AspNetCore.Builder.StaticAssetsEndpointRouteBuilderExtensions.MapStaticAssets(IEndpointRouteBuilder endpoints, String staticAssetsManifestPath)
at Program.
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 inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Task.Wait() at NSwag.Commands.ServiceProviderResolver.GetServiceProviderWithHostFactoryResolver(Assembly assembly) in /_/src/NSwag.Commands/HostApplication.cs:line 165 at NSwag.Commands.ServiceProviderResolver.GetServiceProvider(Assembly assembly) in /_/src/NSwag.Commands/HostApplication.cs:line 66 at NSwag.Commands.Generation.AspNetCore.AspNetCoreToOpenApiGeneratorCommandEntryPoint.Process(String commandContent, String outputFile, String applicationName) in /_/src/NSwag.Commands/Commands/Generation/AspNetCore/AspNetCoreToOpenApiGeneratorCommandEntryPoint.cs:line 26 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 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.RuntimeMethodInfo.Invoke(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 129
Any help is apprishiated.
Regards
The text was updated successfully, but these errors were encountered: