News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Error when compiling sample class  
by Eric Lloyd
posted on 2004/03/17

I'm having a problem trying simply to compile and run the Asynchronous Socket solution. I get two errors:

with this line:
IntPtr cs = SspiProvider.CertOpenStore(new IntPtr(SecurityConstants.CERT_STORE_PROV_FILENAME_A), SecurityConstants.X509_ASN_ENCODING | SecurityConstants.PKCS_7_ASN_ENCODING, 0, 0, file);

the compiler says:

"The best overloaded method match for 'Org.Mentalis.Security.SspiProvider.CertOpenStore(System.IntPtr, int,System.IntPtr, int string)' has some invalid arguments"

and

"Argument '3':cannot convert from 'int' to 'System.IntPtr'"

Has anyone else had this problem?
Just a note, I had to add a reference to the Org.Mentalis.Security.dll file.

Any help?

by Eric Lloyd
posted on 2004/03/17

Well, I found out the compile error is acutally from the Certificate Class. Specifically the CertificateStores.cs file. Is this typically a problem, or am I doing something wrong?

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/03/17

Could you be more specific about how to reproduce this error? What Asynchronous Socket solution are you exactly talking about? Are you talking about one of the Security Library example projects?
I just tried to build the example projects with the latest version of the library and everything worked perfectly...

by Eric Lloyd
posted on 2004/03/18

Well, yes, I was just trying to compile the sample Async. sockets class, but I just tried a simple C# console app, and I still got the error. For some reason, the compilier doesn't like the 3rd arguement (the 0). It is supposed to be a System.IntPtr. Any thoughts?

by Eric Lloyd
posted on 2004/03/18

Well, using your old source code, everything compiles, but now when I try to create a SecureSocket I get the error:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module.

Additional information: File or assembly name System, or one of its dependencies, was not found.

for a console program with only this line of code:

SecureSocket s = new SecureSocket(AddressFamily.InterNetwork, SocketType.Stream,ProtocolType.IP);

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2004/03/18

Oops, our mistake. Looks like we mixed new code of the library with an older version. The code here on our systems compiled fine, but as you reported the online code gave some compile errors.

We've uploaded the updated code, so if you download the archive again [http://www.mentalis.org/soft/projects/seclib/download.qpx] everything should work properly now.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.