Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

nswag.bat file thrown the error, couldn't resolve, Below the errors and the description #6126


User avatar
0
matt created

After using ASP.NET Zero Power Tools for one of my module, below the error generated.

D:\Projects\Astar\angular\nswag>"..\node_modules.bin\nswag" run NSwag NPM CLI NSwag command line tool for .NET 4.6.1+ WinX64, toolchain v11.20.1.0 (NJsonSchema v9.11.0.0 (Newtonsoft.Json v9.0.0.0)) Visit http://NSwag.org for more information. NSwag bin directory: D:\Projects\Astar\angular\node_modules\nswag\bin\binaries\Win

Executing file 'D:\Projects\Astar\angular\nswag\service.config.nswag'... System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:22742 at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) --- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.d__58.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CallSite.Target(Closure , CallSite , Object ) at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0) at NJsonSchema.Infrastructure.DynamicApis.d__16.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.SwaggerDocument.d__59.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.OutputCommandBase.d__5.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.SwaggerGeneration.FromSwaggerCommand.d__9.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.SwaggerGeneration.FromSwaggerCommand.d__8.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.NSwagDocumentBase.d__40.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.NSwagDocument.d__8.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.Document.ExecuteDocumentCommand.d__9.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NSwag.Commands.Document.ExecuteDocumentCommand.d__8.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NConsole.CommandLineProcessor.d__12.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NConsole.CommandLineProcessor.d__11.MoveNext()

--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NConsole.CommandLineProcessor.Process(String[] args, Object input) at NSwag.Commands.NSwagCommandProcessor.Process(String[] args)child_process.js:644 throw err; ^

Error: Command failed: "D:\Projects\Astar\angular\node_modules\nswag\bin/binaries/Win/nswag.exe" run at checkExecSyncError (child_process.js:601:13) at Object.execSync (child_process.js:641:13) at Object. (D:\Projects\Astar\angular\node_modules\nswag\bin\nswag.js:43:22)

at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Function.Module.runMain (module.js:684:10) at startup (bootstrap_node.js:187:16)

Angular compilation error:
ERROR in src/app/main/customerCompany/customerCompanyInfos/create-or-edit-customerCompanyInfo-modal.component.ts(4,10): error TS2305: Module '"D:/Projects/Astar/angular/src/shared/service-proxies/service-proxies"' has no exported member 'CustomerCompanyInfosServiceProxy'.

src/app/main/customerCompany/customerCompanyInfos/create-or-edit-customerCompanyInfo-modal.component.ts(4,44): error TS2305: Module '"D:/Projects/Astar/angular/src/shared/service-proxies/service-proxies"' has no exported member 'CreateOrEditCustomerCompanyInfoDto'. src/app/main/customerCompany/customerCompanyInfos/customerCompanyInfos.component.ts(4,10): error TS2305: Module '"D:/Projects/Astar/angular/src/shared/service-proxies/service-proxies"' has no exported member 'CustomerCompanyInfosServiceProxy'. src/app/main/customerCompany/customerCompanyInfos/customerCompanyInfos.component.ts(4,44): error TS2305: Module '"D:/Projects/Astar/angular/src/shared/service-proxies/service-proxies"' has no exported member 'CustomerCompanyInfoDto'. src/app/main/customerCompany/customerCompanyInfos/view-customerCompanyInfo-modal.component.ts(3,10): error TS2305: Module '"D:/Projects/Astar/angular/src/shared/service-proxies/service-proxies"' has no exported member 'GetCustomerCompanyInfoForView'. src/app/main/customerCompany/customerCompanyInfos/view-customerCompanyInfo-modal.component.ts(3,41): error TS2305: Module '"D:/Projects/Astar/angular/src/shared/service-proxies/service-proxies"' has no exported member 'CustomerCompanyInfoDto'. src/shared/service-proxies/service-proxy.module.ts(8,27): error TS2339: Property 'CustomerCompanyInfosServiceProxy' does not exist on type 'typeof import("D:/Projects/Astar/angular/src/shared/service-proxies/service-proxies")'.


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Can you access the http://localhost:22742/swagger/v1/swagger.json URL?

    in you nswag file: https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/nswag/service.config.nswag#L5

  • User Avatar
    0
    matt created

    yes, it displays in swagger.

    above github url is not accessiable

  • User Avatar
    0
    aaron created
    Support Team

    You need to login with your GitHub account to access the private repo. You can invite yourself here: https://aspnetzero.com/LicenseManagement