zijianhuang / webapiclientgen

Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
MIT License
167 stars 38 forks source link

Error in webapiclientgencore for NG #83

Closed alainjlavoie closed 4 years ago

alainjlavoie commented 4 years ago

Using VS2019, core 3.1.1 Hi, I keep getting this error when executing: CodeGen.GenerateClientAPIs(this.webRootPath, settings, apiDescriptions);

"StartIndex cannot be less than zero. (Parameter 'startIndex')"

I noticed that hostingEnvironment.WebRootPath is null when I run it in debug but I get the error when hitting the controller running in a .exe as well.

I am trying to generate an Angular2 client. Here's the config:

{ "ApiSelections": { "DataModelAssemblyNames": [ "xxxx.Application" ], "CherryPickingMethods": 4 },

"ClientApiOutputs": { "CamelCase": false,

"Plugins": [
  {
    "AssemblyName": "Fonlow.WebApiClientGenCore.NG2",
    "TargetDir": "..\\..\\..\\..\\xxx.Presentation\\src\\ClientApi",
    "TSFile": "xxxClientApi.ts",
    "AsModule": true,
    "ContentType": "application/json;charset=UTF-8"
  }

]

} }

Any idea?

zijianhuang commented 4 years ago

which version of webapiclientgencore ?

Have you tried the latest? 3.5.2

zijianhuang commented 4 years ago

no reponse from op.