You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ApiClientBase class contains a protected string BaseUrl { get; } property which is set in the constructor with a value obtained from the IApiClientConfiguration passed in the constructor.
However, when upgrading to 14.0.3 (or any thing else up to latest 14.0.7), the generated code now contains a private readonly string _baseUrl field (which is used instead of the BaseUrl property in the base class) which is never initialized so I get a CS0649 error when building it - and if I disabled that somehow, the code would still not work as the base url would not be set.
I see no documentation about this breaking change and have been unable to find reasonable way to mitigate this.
I could probably add an abstract method in ApiClientBase that I would invoke from the constructor in the same class (if I disable warnings about virtual methods called from constructor is unsafe) and implement that method to set _baseUrl field from BaseUrl property in a partial hand-coded class alongside the generated code. But that sounds wrong in multiple ways.
What is the intensions with this changed behavior? Or is this a bug?
The text was updated successfully, but these errors were encountered:
I have a working setup with 14.0.2 with the following settings:
The
ApiClientBase
class contains aprotected string BaseUrl { get; }
property which is set in the constructor with a value obtained from theIApiClientConfiguration
passed in the constructor.However, when upgrading to 14.0.3 (or any thing else up to latest 14.0.7), the generated code now contains a
private readonly string _baseUrl
field (which is used instead of theBaseUrl
property in the base class) which is never initialized so I get a CS0649 error when building it - and if I disabled that somehow, the code would still not work as the base url would not be set.I see no documentation about this breaking change and have been unable to find reasonable way to mitigate this.
I could probably add an abstract method in
ApiClientBase
that I would invoke from the constructor in the same class (if I disable warnings about virtual methods called from constructor is unsafe) and implement that method to set_baseUrl
field fromBaseUrl
property in a partial hand-coded class alongside the generated code. But that sounds wrong in multiple ways.What is the intensions with this changed behavior? Or is this a bug?
The text was updated successfully, but these errors were encountered: