Hallo,
ich habe von Globaltrust ein C# Sample erhalten, wo die Zugriffe auf die Globaltrust RKSV Smartcard gezeigt werden. Daraus möchte ich mir die benötigten Codesequenzen in mein X# Modul einbauen.
Allerdings compiliert die XIDE das C# Sample mit einigen Fehlern. Kann mir jemand erklären, was folgende Befehle bedeuten und wie ich die abändere, damit der Compiler sie akzeptiert?
Da hast du vermutlich nicht die neuesten Compiler. Aus dem Code ist leider nicht zu sehen, welcher Typ als dritter Parameter angegeben ist.
Gehen wir mal von int aus. Dann müsste der Code so aussehen:
int result = 0;
int sw = TransmitCommand(_reader, sendBuffer, out result);
if (_context != null)
{
_context.Dispose();
}
Meines Wissens nach bindet die XIDE einen C#-Compiler ein, der Teil des .NET Frameworks ist, und nicht den aus dem Visual Studio.
Das lässt sich aber in den XIDE-Einstellungen ändern.
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Yeah, XIDE uses a c# compiler version found in a default location. I have no idea how to find automatically the latest/newer version, so you have to do it manually. Just go to the Program Files folder and search for csc.exe. There will be plenty, just pick the most recent and set this in Tools/Preferences/Compiler/c#. Then it should work.
But Franz, do you really want to use the c# version of the code, or do you prefer to translate it to X#?
where {0} would stand for the first param you pass in WriteLine() after the string (so the "sw" value) and {0:X2} adds formatting to how the value is shown, in this case in heXadecimal format with 2 digits.
Chris wrote: Wed Nov 12, 2025 12:45 pm
... Just go to the Program Files folder and search for csc.exe. There will be plenty (++), just pick the most recent and set this in Tools/Preferences/Compiler/c#. ...
Isn't that the recipe how to do it automatically?
( (++): just had a look, on my machine there are FORTYSEVEN instances. )
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)