Closed HrolfurHj closed 10 months ago
Although this issue is out of scope for this repository because this is a runtime issue, the relevant team has already released a fix for this issue for the runtime.
It will arrive on all environments around the world within the next week.
The issue was a regression introduced to how the http content is cleared in the last release.
Thus, I will close this issue
1. Describe the bug The error message: Microsoft.Dynamics.Nav.Runtime.NavHttpContent variable not initialized. is thrown when calling
HttpContent.GetHeaders(HttpHeaders)
afterHttpContent.Clear()
and beforeHttpContent.WriteFrom(Text)
. This only happens in the newest release of Business Central and caused runtime errors with our customers because our tests did not cover the code calling a web service.Seems the main issue is the
HttpContent.Clear()
procedure working differently than before and somehow "un-initializing" the variable.2. To Reproduce Simply call
HttpContent.GetHeaders(HttpHeaders)
afterHttpContent.Clear()
and beforeHttpContent.WriteFrom(Text)
3. Expected behavior I expect no error to show up and the Content variable to be actually initialized. This worked before actually and you could set some headers before writing the content, though Content-Type and other headers got overwritten.
4. Actual behavior "Microsoft.Dynamics.Nav.Runtime.NavHttpContent variable not initialized." is thrown when calling
HttpContent.GetHeaders(HttpHeaders)
afterHttpContent.Clear()
5. Versions: