J
Joe
Hello,
I'm currently using a C# class library which is also
converted quickly to a console app by adding a MAIN and adjusting the
building configuration. I'm using this page as a reference to the
code. http://support.microsoft.com/kb/895971 .
I am using the CryptoAPI calls instead of a *.cer file. The only
reason i'm using this method instead is because now a large project of
mine no longer will work properly when using an exported cer file.
This is your typical hit a webservice with a certificate and process
some XML. I put together the C# classlibrary page and created a main
to run some tests on the c# code. Everything works Perfect when
running the console app and obtaining the certificate from the store
and then hitting the URL. BUT when i include the DLL that was created
from the c# class library in a VB project and attempt to run the exact
same code it fails. The line that is causing all the problems is the
function from the crypt32.dll.
currentCertContext = CertEnumCertificatesInStore(storeHandle,
(IntPtr)0);
This line in my C# console app works just fine and returns a HANDLE as
its supposed to thats not zero. But when running thru the exact same
code but thru the VB project calling the objects from the DLL the
currentCertContext is always 0. Causing this process to not gather
any certificates. I don't get how the code alone in its own console
app works just fine but when its included as a DLL in a vb site it
doesn't work. Has anyone ran into anything like this ever? Or heard
anything about this occuring? I can provide more information if
needed. As i debug and walk through the VB app it goes into the DLL
(even opens up the C# page and goes thru the same process) But that
one line isn't producing a proper intptr handle. Any information
would be greatly appreciated.
I'm currently using a C# class library which is also
converted quickly to a console app by adding a MAIN and adjusting the
building configuration. I'm using this page as a reference to the
code. http://support.microsoft.com/kb/895971 .
I am using the CryptoAPI calls instead of a *.cer file. The only
reason i'm using this method instead is because now a large project of
mine no longer will work properly when using an exported cer file.
This is your typical hit a webservice with a certificate and process
some XML. I put together the C# classlibrary page and created a main
to run some tests on the c# code. Everything works Perfect when
running the console app and obtaining the certificate from the store
and then hitting the URL. BUT when i include the DLL that was created
from the c# class library in a VB project and attempt to run the exact
same code it fails. The line that is causing all the problems is the
function from the crypt32.dll.
currentCertContext = CertEnumCertificatesInStore(storeHandle,
(IntPtr)0);
This line in my C# console app works just fine and returns a HANDLE as
its supposed to thats not zero. But when running thru the exact same
code but thru the VB project calling the objects from the DLL the
currentCertContext is always 0. Causing this process to not gather
any certificates. I don't get how the code alone in its own console
app works just fine but when its included as a DLL in a vb site it
doesn't work. Has anyone ran into anything like this ever? Or heard
anything about this occuring? I can provide more information if
needed. As i debug and walk through the VB app it goes into the DLL
(even opens up the C# page and goes thru the same process) But that
one line isn't producing a proper intptr handle. Any information
would be greatly appreciated.