-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue building Swagger during build-time on non-Windows platform #2749
Comments
You're probably using see https://github.com/RicoSuter/NSwag/wiki/NSwag.MSBuild |
Thanks @RicoSuter - saw that shortly after posting the issue. Will make sure this works as expected with some changes and close if so. Thanks so much. Any opportunities for a Teams sync next week? |
@RicoSuter - tried this and out-of-the-box with a 3.1 Web App that doesn't have a Newtonsoft.JSON dependency, it doesn't work. Error below. Will peruse the docs and figure out what to do to resolve, but "as little as possible" would be optimal given the use-case scenario I'm thinking of.
|
Never mind - got it working. I was under the impression that there'd be no need for the inclusion of |
The main problem without Newtonsoft is that System.Text.Json does not expose metadat/reflection api, see #2243 Sure I’m working from home and often available... 🙂 |
In the wiki you describe how to wire up the generation to occur during build, which is of great value. However, when I run this on a Mac, I see that it's specifically calling a tool from the
Win
folder, that's an.exe
. This fails on a Mac with the following error output at build-time.Task "Exec" Environment Variables passed to tool: ASPNETCORE_ENVIRONMENT=Development "/Users/bradygaster/.nuget/packages/nswag.msbuild/13.3.0/build/../tools/Win/NSwag.exe" aspnetcore2openapi /assembly:/Users/bradygaster/source/Weather/bin/Debug/netcoreapp3.1/Weather.dll /output:swagger.json /var/folders/yd/yx7g3rbn1rn9n5x_pr65m0980000gn/T/tmp4180e802dbe54195a9ca0ca149253efb.exec.cmd: line 2: /Users/bradygaster/.nuget/packages/nswag.msbuild/13.3.0/build/../tools/Win/NSwag.exe: cannot execute binary file 1:7>/Users/bradygaster/source/Weather/Weather.csproj(15,5): error MSB3073: The command ""/Users/bradygaster/.nuget/packages/nswag.msbuild/13.3.0/build/../tools/Win/NSwag.exe" aspnetcore2openapi /assembly:/Users/bradygaster/source/Weather/bin/Debug/netcoreapp3.1/Weather.dll /output:swagger.json" exited with code 126. Done executing task "Exec" -- FAILED. 1:7>Done building target "NSwag" in project "Weather.csproj" -- FAILED. 1:7>Done Building Project "/Users/bradygaster/source/Weather/Weather.csproj" (default targets) -- FAILED.
Is there an upcoming fix for this? It seems limiting that this is only available on Windows, when .NET Core and MSBuild are available on on other platforms.
Would love to sync up on some ideas I have for using this, but they'd require it work on non-Windows as well, given the use-case.
The text was updated successfully, but these errors were encountered: