object to long cast
-
Hi all. I have this vexxing problem which showed up when I moved from my dev/test box to a production server. What I'm trying to do is get the pwdLastSet property from Active Diretory. I'm using a DirectorySearcher object to get the pwdLastSet property. Once you get the property, you can cast the data to a long to get the total ticks since 1970. This works like a dream on my XP/IIS 5.1/ASP.Net 2.0 box. Once I moved it out to the Windows 2000/IIS 5.0/ASP.net 2.0 production server, the casting fails. It is my understanding that the DirectorySearcher object is supposed to marshall the data from Active Directory into something that's easier to use. I see this being done in my debugging sessions on my dev box. I would love to setup a debugging session on the production server, but that's a whole other set of issues. I do notice though if I take that whole class where the error is happening, put it into a simple C# windows app, compile it on my dev box, it will run correctly on the production server. I'm thinking that when it gets compiled on the production server, the marshalling doesn't happen corretly. I'm now leaning towards sticking the offending code into a dll. Has anybody else seen this type of issue? Is there some compile time flags that can be set? Keith
-
Hi all. I have this vexxing problem which showed up when I moved from my dev/test box to a production server. What I'm trying to do is get the pwdLastSet property from Active Diretory. I'm using a DirectorySearcher object to get the pwdLastSet property. Once you get the property, you can cast the data to a long to get the total ticks since 1970. This works like a dream on my XP/IIS 5.1/ASP.Net 2.0 box. Once I moved it out to the Windows 2000/IIS 5.0/ASP.net 2.0 production server, the casting fails. It is my understanding that the DirectorySearcher object is supposed to marshall the data from Active Directory into something that's easier to use. I see this being done in my debugging sessions on my dev box. I would love to setup a debugging session on the production server, but that's a whole other set of issues. I do notice though if I take that whole class where the error is happening, put it into a simple C# windows app, compile it on my dev box, it will run correctly on the production server. I'm thinking that when it gets compiled on the production server, the marshalling doesn't happen corretly. I'm now leaning towards sticking the offending code into a dll. Has anybody else seen this type of issue? Is there some compile time flags that can be set? Keith
An update. I tried to precompile the whole site and making the offending class a dll by itself. Both options give me invalid casts still. Is there additional compilation going on? It just seems to work everywhere besides inside the asp.net worker process for Win2000...
-
Hi all. I have this vexxing problem which showed up when I moved from my dev/test box to a production server. What I'm trying to do is get the pwdLastSet property from Active Diretory. I'm using a DirectorySearcher object to get the pwdLastSet property. Once you get the property, you can cast the data to a long to get the total ticks since 1970. This works like a dream on my XP/IIS 5.1/ASP.Net 2.0 box. Once I moved it out to the Windows 2000/IIS 5.0/ASP.net 2.0 production server, the casting fails. It is my understanding that the DirectorySearcher object is supposed to marshall the data from Active Directory into something that's easier to use. I see this being done in my debugging sessions on my dev box. I would love to setup a debugging session on the production server, but that's a whole other set of issues. I do notice though if I take that whole class where the error is happening, put it into a simple C# windows app, compile it on my dev box, it will run correctly on the production server. I'm thinking that when it gets compiled on the production server, the marshalling doesn't happen corretly. I'm now leaning towards sticking the offending code into a dll. Has anybody else seen this type of issue? Is there some compile time flags that can be set? Keith
Just to cap this off, whatever the problem was became fixed after doing a iisreset. I discovered this on accident while attempting to get remote debugging running. So one problem down, one to go.