Changed functionality in system.directoryservices ver. 1.1.4322.20

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

we have the following problem. We like to update a LDAP diretory using
system.directoryservices. This worked fine in the past but now it stopped
working, we get a System.NotSupportedException. We use the following syntax:
<DirectoryEntry>.Properties[<attribute>][0] = <value>;

Further research turned out that this does work using
system.directoryservices.dll 1.1.4322.573 but doesn't work using version
1.1.4322.2032.

To investigate the difference I used Reflector (c# disassembler). I found
the following code (for set_item) in version 1.1.4322.2032:
if (this.needNewBehavior && !this.allowMultipleChange)
{
throw new NotSupportedException();
}
base.List[index] = value;

Version 1.1.4322.573 doesn't has this "if" criteria, it simply sets the
value. If I look at the values using the debugger I see that
this.allowMultipleChange is false and needNewBehavior is true, therefore I
get a NotSupportedException().

So now I have a huge problem: I can't update my LDAP anymore.

Can anybody help me with this problem?
Or does anybody know where I can find documentation about the differences in
the different releases of a dll?
Or does anybody know where I can find system.directoryservices newsgroups?
Or does anybody know how to contact miscrosoft about this matter (somebody
must have changed the code for some reason without documenting it)?

Thanks,
René
 
René Titulaer said:
Dear all,

we have the following problem. We like to update a LDAP diretory using
system.directoryservices. This worked fine in the past but now it stopped
working, we get a System.NotSupportedException. We use the following
syntax:
<DirectoryEntry>.Properties[<attribute>][0] = <value>;

Further research turned out that this does work using
system.directoryservices.dll 1.1.4322.573 but doesn't work using version
1.1.4322.2032.

To investigate the difference I used Reflector (c# disassembler). I found
the following code (for set_item) in version 1.1.4322.2032:
if (this.needNewBehavior && !this.allowMultipleChange)
{
throw new NotSupportedException();
}
base.List[index] = value;

Version 1.1.4322.573 doesn't has this "if" criteria, it simply sets the
value. If I look at the values using the debugger I see that
this.allowMultipleChange is false and needNewBehavior is true, therefore I
get a NotSupportedException().

So now I have a huge problem: I can't update my LDAP anymore.

Can anybody help me with this problem?
Or does anybody know where I can find documentation about the differences
in
the different releases of a dll?
Or does anybody know where I can find system.directoryservices newsgroups?
Or does anybody know how to contact miscrosoft about this matter (somebody
must have changed the code for some reason without documenting it)?

Thanks,
René

Try:

.....Properties[<attribute>][0].Value = ...


Willy.
 
Thanks a lot, this works.

Although I think you made a type mistake, probably you meant:
......Properties[<attribute>].Value = ...

instead of

......Properties[<attribute>][0].Value = ...

Thanks again.

Willy Denoyette said:
René Titulaer said:
Dear all,

we have the following problem. We like to update a LDAP diretory using
system.directoryservices. This worked fine in the past but now it stopped
working, we get a System.NotSupportedException. We use the following
syntax:
<DirectoryEntry>.Properties[<attribute>][0] = <value>;

Further research turned out that this does work using
system.directoryservices.dll 1.1.4322.573 but doesn't work using version
1.1.4322.2032.

To investigate the difference I used Reflector (c# disassembler). I found
the following code (for set_item) in version 1.1.4322.2032:
if (this.needNewBehavior && !this.allowMultipleChange)
{
throw new NotSupportedException();
}
base.List[index] = value;

Version 1.1.4322.573 doesn't has this "if" criteria, it simply sets the
value. If I look at the values using the debugger I see that
this.allowMultipleChange is false and needNewBehavior is true, therefore I
get a NotSupportedException().

So now I have a huge problem: I can't update my LDAP anymore.

Can anybody help me with this problem?
Or does anybody know where I can find documentation about the differences
in
the different releases of a dll?
Or does anybody know where I can find system.directoryservices newsgroups?
Or does anybody know how to contact miscrosoft about this matter (somebody
must have changed the code for some reason without documenting it)?

Thanks,
René

Try:

.....Properties[<attribute>][0].Value = ...


Willy.
 
René Titulaer said:
Thanks a lot, this works.

Although I think you made a type mistake, probably you meant:
.....Properties[<attribute>].Value = ...

instead of

.....Properties[<attribute>][0].Value = ...

Thanks again.

:

Exactl, cut and paste mistake.

Willy.
 
Can anybody help me with this problem?

I got some answers from fellow Directory Services MVP Joe Kaplan, and
from Microsoft fellow Matt Rimer on this - check 'em out:

[Joe Kaplan]
This is a known issue related to the recent service pack releases.
Generally, using the .Value syntax solves the problem.

Given that there are some hotfixes associated with the service pack
release that address this issue, it would be helpful to get a list of
the hotfixes and what OS's they apply to as I'm not sure all versions
of ADSI are affected the same way.

[Matt Rimer @ Microsoft.com]
Do KB articles 886541 and 835763 clarify matters at all?

Thanks,
Matt

http://support.microsoft.com/default.aspx?scid=kb;en-us;886541
http://support.microsoft.com/default.aspx?scid=kb;en-us;835763

HTH
Marc
 
Back
Top