Hallo,
ich habe mir von github eine C# Sample App geladen, die ich nach X# transportieren wollte. Die C# Sample App habe ich in der XIDE compiliert und erhalte den Fehler
error CS1070: The type name 'X509Certificate2' could not be found. This type has been forwarded to assembly 'System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. Consider adding a reference to that assembly. 18,25 AbstractCashRegisterSmardCard.cs Cashregister.Smartcard.AbstractCashRegisterSmardCard:ReadCertificate
Lib und Namespace System.Security.Cryptography.X509Certificates sind eingebunden, laut www ist diese für X509Certificate2 notwendig.
Was könnte das Problem sein?
LG Franz
C# und X509Certificate2
Moderator: wriedmann
Re: C# und X509Certificate2
Hallo Franz,
System ist als Lib eingebunden?
Wolfgang
System ist als Lib eingebunden?
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Re: C# und X509Certificate2
Hallo Wolfgang,
habe ich nun eingebunden, damit bringt mir der Compiler fehlende type/namespace Meldungen: CngKey, ECDsaCng, etc.
Die sollten in System.Security.Cryptography enthalten sein, die lib finde ich aber nicht in der Property Liste.
LG
habe ich nun eingebunden, damit bringt mir der Compiler fehlende type/namespace Meldungen: CngKey, ECDsaCng, etc.
Die sollten in System.Security.Cryptography enthalten sein, die lib finde ich aber nicht in der Property Liste.
LG
Re: C# und X509Certificate2
Hi Franz,
See https://learn.microsoft.com/en-us/dotne ... mework-4.8, this type for example is included in System.Core.dll, so you need to add this in the references
See https://learn.microsoft.com/en-us/dotne ... mework-4.8, this type for example is included in System.Core.dll, so you need to add this in the references
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: C# und X509Certificate2
Hi Chris,
thank you for this info, now XIDE shows 3 errors (hope these are the last):
- CS0246 type or namespace 'ICardReader' not found
- CS1061 PCSC.SCardContext does not contain a definition for 'ConnectReader'
- CS0246 type or namespace 'ReaderStatus' not found
Do you know what to do?
regards Franz
thank you for this info, now XIDE shows 3 errors (hope these are the last):
- CS0246 type or namespace 'ICardReader' not found
- CS1061 PCSC.SCardContext does not contain a definition for 'ConnectReader'
- CS0246 type or namespace 'ReaderStatus' not found
Do you know what to do?
regards Franz
Re: C# und X509Certificate2
Hi Franz,
You're probably missing some using statements. Can you please post a link to the original source code you found and use?
You're probably missing some using statements. Can you please post a link to the original source code you found and use?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: C# und X509Certificate2
Hi Chris,
https://github.com/A-Trust/RKSV/tree/ma ... 20Examples
a.sign RK CHIP / APDU Examples / csharp / SampleClient
Regards
https://github.com/A-Trust/RKSV/tree/ma ... 20Examples
a.sign RK CHIP / APDU Examples / csharp / SampleClient
Regards
Re: C# und X509Certificate2
Hi Franz,
There are several .cs files in there, not sure which one you are using. Did you include all the using statements from the one you are using? Also have you added the references to the necessary dlls?
There are several .cs files in there, not sure which one you are using. Did you include all the using statements from the one you are using? Also have you added the references to the necessary dlls?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: C# und X509Certificate2
Hi Chris,
attached you find my XIDE C# application
Regards
attached you find my XIDE C# application
Regards
- Attachments
-
- CSharpSampleClient.zip
- (17.98 KiB) Downloaded 85 times
Re: C# und X509Certificate2
Hi Franz,
I am not familiar with the dll structure of this product, but from what I see in their sample, they have two references to external dll files, one to PCSC.dll and another to PCSC.Iso7816.dll. Your contains only one references, to a different named dll, pcsc-sharp.dll.
I don't know if you did this because you needed different functionality, but when I added the same dlls as the original sample uses, then your code compiles with no errors.
I took the dlls drom this browsers, after unzipping the sample code, downloaded from git:
\RKSV-main\a.sign RK CHIP\APDU Examples\csharp\packages\PCSC.5.0.0\lib\net40\PCSC.dll
\RKSV-main\a.sign RK CHIP\APDU Examples\csharp\packages\PCSC.Iso7816.5.0.0\lib\net40\PCSC.Iso7816.dll
I also tried the net472 versions (instead of net40), and that worked fine, too.
I am not familiar with the dll structure of this product, but from what I see in their sample, they have two references to external dll files, one to PCSC.dll and another to PCSC.Iso7816.dll. Your contains only one references, to a different named dll, pcsc-sharp.dll.
I don't know if you did this because you needed different functionality, but when I added the same dlls as the original sample uses, then your code compiles with no errors.
I took the dlls drom this browsers, after unzipping the sample code, downloaded from git:
\RKSV-main\a.sign RK CHIP\APDU Examples\csharp\packages\PCSC.5.0.0\lib\net40\PCSC.dll
\RKSV-main\a.sign RK CHIP\APDU Examples\csharp\packages\PCSC.Iso7816.5.0.0\lib\net40\PCSC.Iso7816.dll
I also tried the net472 versions (instead of net40), and that worked fine, too.
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu

