Sp-dev-docs: code in doc: fix parameter "wi"

Created on 7 Dec 2020  ·  5Comments  ·  Source: SharePoint/sp-dev-docs

[fix parameter "wi"]

TokenWaitInfo wi = new TokenWaitInfo();
wi.Handle = ThreadPool.RegisterWaitForSingleObject(
...................................................................................................
if (!timedOut)
{
TokenWaitInfo wi1 = (TokenWaitInfo)state;
if (wi1.Handle != null)
{
wi1.Handle.Unregister(null);
}
}
...................................................................................................
,wi,
(uint)CalculateThreadSleep(accessToken).TotalMilliseconds,
)


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Good First Issue 🏆 csorest docs docs-comment help wanted bug-confirmed

All 5 comments

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Can you please provide more context around your submission? What's wrong with the existing, what are you changing, etc. Providing updated code with zero context isn't clear...

I run the code from link: https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/using-csom-for-dotnet-standard
see that:

  • variable "wi" was declared firstly at line: "TokenWaitInfo wi = new TokenWaitInfo();"
  • and variable "wi" was declared secondly at line: "TokenWaitInfo wi = (TokenWaitInfo)state;"
    please update for build/running with visual studio 2019.

Oh... so you're saying the code in the doc is incorrect because it overwrites an existing variable? OK... that makes sense.

It helps to explain WHY something is wrong and WHAT you're fixing rather than just submitting code saying "fixes X" :)

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues

Was this page helpful?
0 / 5 - 0 ratings