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
GetDirectorySynchronizationCookie() returns empty cookie #49376
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
I am experiencing the same 0-byte cookie problem; however, it seems isolated to the version of System.DirectoryServices not net5.0 vs netcoreapp3.1.
|
After some more research it looks like in the past the DirectorySearcher class, in the FindAll() private method, it would set an internal SearchResultCollection searchResult property. runtime/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs Lines 677 to 679 in 60d1224
This internal searchResult property is what is used to set the DirsyncCookie when you call directorySearcher.DirectorySynchronization. runtime/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs Lines 503 to 508 in eb7ef11
Now in the FindAll() code it just returns a new SearchResultCollection without populating the internal searchResult property. Which I believe is the root of the problem. runtime/src/libraries/System.DirectoryServices/src/System/DirectoryServices/DirectorySearcher.cs Line 664 in eb7ef11
|
@Thomas-Avery thanks for the great investigation! Have you had a chance to revert that change to again set searchResult property and validate that this fixes the issue you are facing? |
I don't think that we'll get to fix this in 6.0.0 so moving it to 7.0.0 for now. |
The same error is happening for:
Workaround: I have used |
+1 |
@knoxi did the workaround provided above by @arora-kushal not work for you? |
@joperezr I didn't tried this one, since I'm not sure if the behavior is still the same when using |
This was fixed by #79093, could be closed |
Yep, it is fixed and the fix ported to 6.0/7.0 |
Thanks, leaving the issue open for adding a test |
Description
System.DirectoryServices.DirectorySynchronization.GetDirectorySynchronizationCookie()
returns an invalid, 0-byte cookie onnet5.0
. A valid cookie is returned when running the same code onnetcoreapp3.1
.Repro: https://github.com/EvanMulawski/DotNetDirectoryServicesDirSyncIssue
Configuration
net5.0
(5.0.3)Regression?
Works in:
netcoreapp3.1
(3.1.12)The text was updated successfully, but these errors were encountered: