🐛 Fix generated C# clients using base URL #4674
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I do believe that the following PR introduced a typo in the #pragma directive.
https://github.com/RicoSuter/NSwag/pull/4634/files#diff-65b33706483249f53a8138451372e3d3276b904d815dcb71d0ed0c8786ea2e70R8
I think it slipped through testing because it only concerns generated C# clients generated using the UseBaseUrl=true option.
When trying to generate my client with this option enabled (unfortunately, I can't do without it), I'm getting the following compiler error on the
#pragma restore disable 8618
line:error CS1633: Unrecognized #pragma directive
.I'm by no means an expert on these directives, but I do believe that the correct syntax is
#pragma warning restore 8618
.This PR should fix the issue, introduced in NSwag 14.0.0.
Fixes: #4673