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é

Re: Changed functionality in system.directoryservices ver. 1.1.4322.20 by Willy

Willy
Mon Apr 18 07:45:23 CDT 2005


"René Titulaer" <RenTitulaer@discussions.microsoft.com> wrote in message
news:75DC0505-CCD7-45BC-8F4B-903F5F6F2F0D@microsoft.com...
> 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.



Re: Changed functionality in system.directoryservices ver. 1.1.432 by RenTitulaer

RenTitulaer
Mon Apr 18 09:20:01 CDT 2005

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 [MVP]" wrote:

>
> "René Titulaer" <RenTitulaer@discussions.microsoft.com> wrote in message
> news:75DC0505-CCD7-45BC-8F4B-903F5F6F2F0D@microsoft.com...
> > 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.
>
>
>

Re: Changed functionality in system.directoryservices ver. 1.1.432 by Willy

Willy
Mon Apr 18 12:47:49 CDT 2005


"René Titulaer" <RenTitulaer@discussions.microsoft.com> wrote in message
news:36E9DC14-BA84-4C53-985F-ACF2D1FB2A69@microsoft.com...
> 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 [MVP]" wrote:
>

Exactl, cut and paste mistake.

Willy.



Re: Changed functionality in system.directoryservices ver. 1.1.4322.20 by Marc

Marc
Tue Apr 19 04:32:25 CDT 2005

>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