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

[bug] NSwag v14.0.4 breaks on MemberNotNullAttribute, change 'Avoid generating unused _baseUrl (C# gen)' #4833

Closed
sommmen opened this issue Mar 25, 2024 · 5 comments

Comments

@sommmen
Copy link

sommmen commented Mar 25, 2024

Hello,

The latest release breaks, because of the following commit:
Avoid generating unused _baseUrl (C# gen) 202f3c2
image

C:\Repos\lightr\src\Lightr\Lightr\obj\docsClient.cs(573,46,573,59): error CS0122: 'MemberNotNullAttribute' is inaccessible due to its protection level

https://github.com/sommmen/lightr/actions/runs/8416578516/job/23043462539?pr=5

The code is public:
https://github.com/sommmen/lightr/tree/dependabot/nuget/NSwag.ApiDescription.Client-14.0.4
Api doc can be found here:
https://github.com/sommmen/lightr/blob/dependabot/nuget/NSwag.ApiDescription.Client-14.0.4/src/Lightr/Lightr/OpenAPIs/docs.json

@sommmen
Copy link
Author

sommmen commented Mar 25, 2024

Related so:

If your open documentation you will see that NotNullWhenAttribute applies to:

  • .NET Core 3.0, Core 3.1, 5, 6, 7, 8
  • .NET Standard 2.1

TBH I failed to build lib against .NET Standard 2.1 also, but you try can either install nuget like this one or implement this attribute yourself (like it is done in the runtime), cause AFAIK compiler quite often relies on naming and/or duck typing.

https://stackoverflow.com/a/61574692/4122889

My project targets netstandard2.1 so this should work but it seems to fail for some reason.

@sommmen
Copy link
Author

sommmen commented Mar 25, 2024

this could be a dupe or regression of #4704

@sommmen sommmen changed the title NSwag v14.0.4 breaks on MemberNotNullAttribute, change 'Avoid generating unused _baseUrl (C# gen)' [bug] NSwag v14.0.4 breaks on MemberNotNullAttribute, change 'Avoid generating unused _baseUrl (C# gen)' Mar 25, 2024
@Vogel612
Copy link

Duplicates #4763 in addition

@vvdb-architecture
Copy link

Same problem in 14.0.5. Our proxies target NetStandard2.0, and it fails there as well.

@RicoSuter
Copy link
Owner

v14.0.6

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

No branches or pull requests

4 participants