Skip to content
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

🐛 Fix generated C# clients using base URL #4674

Merged
merged 1 commit into from
Jan 10, 2024
Merged

🐛 Fix generated C# clients using base URL #4674

merged 1 commit into from
Jan 10, 2024

Conversation

elafarge
Copy link
Contributor

@elafarge elafarge commented Jan 4, 2024

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

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
@anev-auror
Copy link

Is there an expected release date for this fix?

@RicoSuter RicoSuter merged commit 86aaf35 into RicoSuter:master Jan 10, 2024
1 check passed
@elafarge elafarge deleted the fix-csharp-client-generation-using-base-url branch January 10, 2024 13:27
lahma pushed a commit to lahma/NSwag that referenced this pull request Jun 13, 2024
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: RicoSuter#4673
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unrecognized pragma directive in C# clients generated by NSwag.MSBuild 14.0.0
6 participants