Assembly parameter value for nswag aspnetcore2swagger command
See original GitHub issueI’m trying to use latest version of nswag (11.18.7 at the moment) from msbuild in asp.net core project (netcoreapp2.1) and aspnetcore2swagger command just doesn’t work. Error is always System.IO.FileNotFoundException no matter if I use full assembly path, relative path from project folder or just assembly name. I’m using it the way it is recommended in the documentation for .NET Core projects:
<Target Name="NSwag" AfterTargets="Build">
<Copy SourceFiles="@(ReferencePath)" DestinationFolder="$(OutDir)References" />
<Message Importance="high" Text="Run '$(NSwagExe_Core21) aspnetcore2swagger /assembly:$(OutDir)$(AssemblyName).dll'" />
<Exec Command="$(NSwagExe_Core21) aspnetcore2swagger /assembly:$(OutDir)$(AssemblyName).dll" />
<RemoveDir Directories="$(OutDir)References" />
</Target>
If I just replace aspnetcore2swagger command with webapi2swagger without making any other changes - it works perfectly.
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (16 by maintainers)
Top Results From Across the Web
Get started with NSwag and ASP.NET Core
Package installation · Right-click the project in Solution Explorer > Manage NuGet Packages · Set the Package source to "nuget.org" · Enter "NSwag....
Read more >swagger - Best practices for using NSwag ...
I've been using NSwag for a while to generate an Angular TS client to ... Command="$(NSwagExe_Core21) webapi2swagger /assembly:$(OutDir)RR.
Read more >asp.net core - Why do NSwag fail on my computer and not ...
NSwag is looking for the program class in the assembly you want's to create a proxyclient for. It does that by refelction and...
Read more >Executing CLI Tools
Executing CLI Tools. Interacting with third-party command-line interface tools (CLIs) is an essential task in build automation.
Read more >Using OpenApiReference To Generate Open API Client ...
I have been using Rico Suter's brilliant NSwag for some time now to generate client code for working with HTTP API endpoints.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ve tried debugging this issue, but I got stuck at
IsolatedCommandBase.RunIsolatedAsync
, unable to step into theTask.Run
code.But I also found a satisfactory workaround by using
$(OutDir)
to set the working directory instead of passing it to/assembly:
: