C
C#2y ago
Hulkstance

Swagger Doc failed

What's wrong with it?
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="dotnet tool restore"/>
<Exec Command="dotnet swagger tofile --output $(SolutionDir)api.json $(OutputPath)$(AssemblyName).dll v1"/>
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="dotnet tool restore"/>
<Exec Command="dotnet swagger tofile --output $(SolutionDir)api.json $(OutputPath)$(AssemblyName).dll v1"/>
</Target>
18 Replies
Hulkstance
HulkstanceOP2y ago
phaseshift
phaseshift2y ago
You have a space in one of your paths?
Hulkstance
HulkstanceOP2y ago
dotnet swagger tofile --output C:\Users\user\Desktop\RF-V48_4G GPS_tracking_bracelet\navtrack-main\api.json bin\Debug\net6.0\Navtrack.Api.dll v1 ugh I replaced these spaces with underscores but I accidentally left one thanks! @phaseshift is there a way to escape the spaces tho? Perhaps single quotes?
phaseshift
phaseshift2y ago
Depends what shell the command is running in. Wrap in double quotes is normally ok
Hulkstance
HulkstanceOP2y ago
Hulkstance
HulkstanceOP2y ago
@phaseshift single quotes don't work, just confirmed so does double quotes cuz of the enclosing quotes
phaseshift
phaseshift2y ago
Yeah, so escape them
Hulkstance
HulkstanceOP2y ago
phaseshift
phaseshift2y ago
Nope. Google it
Hulkstance
HulkstanceOP2y ago
Hulkstance
HulkstanceOP2y ago
that works but kinda looks ugly
phaseshift
phaseshift2y ago
Don't use spaces 🤷‍♂️
Hulkstance
HulkstanceOP2y ago
I feel DevOps when they have to deal with such issues daily
phaseshift
phaseshift2y ago
Nobody in dev ops puts spaces in paths 😅
Hulkstance
HulkstanceOP2y ago
Hulkstance
HulkstanceOP2y ago
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="dotnet tool restore"/>
<Exec Command="dotnet swagger tofile --output %22$(SolutionDir)api.json%22 %22$(OutputPath)$(AssemblyName).dll%22 v1"/>
</Target>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="dotnet tool restore"/>
<Exec Command="dotnet swagger tofile --output %22$(SolutionDir)api.json%22 %22$(OutputPath)$(AssemblyName).dll%22 v1"/>
</Target>
I will keep it that way since Microsoft recommends it thanks and merry xmas! 😛
Anton
Anton2y ago
don't use msbuild for targets, use Nuke just don't, you're wasting your time
Hulkstance
HulkstanceOP2y ago
@AntonC agreed, I actually use Nuke myself but that's a project I wanted to run
Want results from more Discord servers?
Add your server