Search code examples
nswagnswagstudio

NSwagStudio 14.0.0 - Unable to select .NET Assembly option to generate client


On our project we updated solution from .Net 6.0 to .Net 8.0. Everything went smooth. Now I wanted to generate a client for our application. Before we used NSwagStudio 13.20.0.0 tool for such generation - I build the project and selected it through .NET Assembly option in NSwagStudio. enter image description here

Now I see on official NSwag site that .Net 8.0 support was added in NSwagStudio 14.0.0-preview8 version, so I updated it. And now I see that there is no .NET Assembly option anymore. enter image description here

And when I try to open old nswag config file, I get error enter image description here

Error text:

Error setting value to 'SelectedSwaggerGeneratorRaw' on 'NSwag.Commands.NSwagDocument'.
Newtonsoft.Json.JsonSerializationException: Error setting value to 'SelectedSwaggerGeneratorRaw' on 'NSwag.Commands.NSwagDocument'. ---> System.NullReferenceException NSwag.Commands.NSwagDocumentBase.set_SelectedSwaggerGeneratorRaw(JObject value)

в Newtonsoft.Json.Serialization.DynamicValueProvider.SetValue(Object target, Object value)

If I try to generate client via console command, I get another error enter image description here

Error text:

System.InvalidOperationException: The command 'run c:/git/workplacer/mapeditor/mapeditor.integrationtests/client/nswag.json /runtime:net80' could not be found.
в NConsole.CommandLineProcessor.<ProcessSingleAsync>d__12.MoveNext()

So I am kinda blocked and don't know what to do, other than just wait for official 14.0 version release. Does anyone know how to fix this issue? Thanks in advance.


Solution

  • See this discussion https://github.com/RicoSuter/NSwag/issues/4524

    v14 is not supporting an assembly anymore

    besides, .NET8 runtime (CLI) will be fixed in 14.0.1