MonoOniLibrary

2025-12-10 0 177

MonoOniLibrary

Mono on IBM i Library (MONOI) Containing MONO CL Command Wrapper to call .Net applications in PASE from CL, RPG or COBOL applications on IBM i and get return results (STDOUT) from the applications in one of the following formats: IFS file, OUTFILE, job log entries or spool file.

The main benefit of this wrapper is to be able to integrate .Net applications on-the-fly with standard IBM i job streams.

Requirements for using the MONO CL Commands

The Mono runtime environment must be installed on your IBM i. This can be done via downloading a binary save file or by using a custom Yum repository to install via the IBM i Access Client Solutions (ACS) Client Open Source Package Management option from the Tools menu.

Installing via Save File Distribution

Mono for IBM i must be installed. Mono for IBM i binary save file distribution can be downloaded from here:
https://gith***ub.com/MonoOni/binarydist

Follow instructions for installing the Mono environment in /opt/mono.

Installing via Yum Repository (Don\’t use Yum install currently if doing VB dev – Missing Microsoft.VisualBasic.dll missing from GAC

On the IBM i Manually create the following repository file via the EDTF command or create it via Windows notepad and upload to the IFS location for the Yum repositories. Ex: EDTF STMF(\’/QOpenSys/etc/yum/repos.d/qsecofr.repo\’)

Note: If you create the qsecofr.repo file with EDTF, make sure before entering any text in the file, press Shift-F3/F15 for the EDTF Options Screen. Set the Selection value to: 3 and value for Change the CCSID of file to: 00819 and press Enter and then F12 to return to the editor. This will insure the data gets written to the qsecofr.repo file in ASCII format when it\’s saved. After saving and closing the file, run the following command:

WRKLNK OBJ(\’/QOpenSys/etc/yum/repos.d/qsecofr.repo\’) and then select option 8 on qsecofr.repo. Coded character set ID should say: 819

Repo file name: /QOpenSys/etc/yum/repos.d/qsecofr.repo

The contents of the repo file should be:

[qsecofr]
name=QSECOFR IBM i RPM Repo
baseurl=http://repo.*qs*e*co.fr
enabled=1
gpgcheck=0

After creating the new repository IFS file qsecofr.repo, you can launch the Open Source Package Management utility from IBM ACS Client via the Tools menu and you\’ll see the new Available Packages. Select mono-complete and click the install option. This should complete the Mono install to the /QopenSys/pkgs folder location for apps installed by Yum on IBM i.

Note: I noticed that on the Yum install that the Microsoft.VisualBasic.dll runtime file is not included in the GAC (Global Assembly Cache). This causes a problem when running a VB app. Your VB app will get an error about a missing Microsoft.VisualBasic.dll file and will crash.

Microsoft.VisualBasic.dll should be located in the following location: /QOpenSys/pkgs/lib/mono/gac/Microsoft.VisualBasic/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
There\’s a secondary file needed in the GAC as well:
/QOpenSys/pkgs/lib/mono/gac/Microsoft.VisualBasic/10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll.mdb

You can install the save file version of Mono to /opt/mono and then copy the Microsoft.VisualBasic.dll files from /opt/mono/lib/mono/Microsoft.VisualBasic/10.0.0.0__b03f5f7f11d50a3a to /QOpenSys/pkgs/lib/mono/gac/Microsoft.VisualBasic/10.0.0.0__b03f5f7f11d50a3a

I have a note out to the Yum package author to see if he can fix the Yum build.

Installing MONOI library and creating MONO command objects

Download the monoi.savf save file from the selected releases page.

https://githu*b.co**m/richardschoen/MonoOniLibrary/releases

Upload the monoi.savf to the IFS and place it in /tmp/monoi.savf

Run the following commands to copy the save file from the IFS into a SAVF object

CRTSAVF FILE(QGPL/MONOI)

CPYFRMSTMF FROMSTMF(\'/tmp/monoi.savf\') TOMBR(\'/qsys.lib/qgpl.lib/monoi.file\') MBROPT(*REPLACE) CVTDTA(*NONE)

Restore the MONOI library

RSTLIB SAVLIB(MONOI) DEV(*SAVF) SAVF(QGPL/MONOI)

Build the MONOI commands

ADDLIBLE MONOI

CRTCLPGM PGM(MONOI/SRCBLDC) SRCFILE(MONOI/SOURCE) SRCMBR(SRCBLDC) REPLACE(*YES)

CALL PGM(MONOI/SRCBLDC)

Using the MONO CL command to call a .Net console or other application

The following example calls a program named: Sample1.exe from the /mydotnet directory and passes the program 2 parameters individually vi the MONO CL command. See the MONO2 command if you want to pass all parms in a single parameter value instead. More of a preference thing.

MONO WORKDIR(\’/mydotnet\’)
EXEFILE(Sample1.exe)
ARGS(\’Parm1 value\’ \’Parm 2 value\’)
OUTFILE(MONOSTDOUT)
MONOPATH(\’/QOpenSys/pkgs/bin\’)
DSPSTDOUT(*NO)
LOGSTDOUT(*YES)
PRTSTDOUT(*NO)
DLTSTDOUT(*YES)

MONO command parms

WORKDIR – The IFS location for the .Net program you want to call.

EXEFILE – The .Net program you want to call.

ARGS – Command line parameters. Up to 40 args can be passed to a .Net program call. Do NOT put double quotes around parms or your program call may get errors because your parameters get compromised with double quotes. Double quotes are added automatically inside the CL command processing program. Single quotes are allowed around your parmaeter data: Ex: \’My Parm Value 1\’ \’My Parm Value 2\’

OUTFILE – The output file which will receive STDOUT lokking feedback.

MONOPATH – This is the location of the Mono binary. The mono executable runs your .Net program code.
Specify /QOpenSys/pkgs/bin if you loaded Mono via the Yum repository. (Default)
Specify /opt/mono/bin if you loaded Mono via the save file from the following link: https://gith***ub.com/MonoOni/binarydist

DSPSTDOUT – Display the outfile contents. Nice when debigging.

LOGSTDOUT – Place STDOUT log entries into the current jobs job log. Use this if you want the log info in the IBM i joblog.

PRTSTDOUT – Print STDOUT to a spool file. Use this if you want a spool file of the log output.

DLTSTDOUT – This option insures that the STDOUT IFS temp files get cleaned up after processing. All IFS log files get created in the /tmp/mono directory.

Using the MONO2 CL command to call a .Net console or other application

The following example calls a program named: Sample1.exe from the /mydotnet directory and passes the program 2 parameters all in a single parameter field delimited by double quotes via the MONO2 CL command. See the MONO command if you want to pass each parameter individually without specifying double quotes. More of a preference thing.

The following example calls a program named: Sample1.exe from the /mydotnet directory and passes the program 2 parameters.

MONO2 WORKDIR(\’/mydotnet\’)
EXEFILE(Sample1.exe)
ARGS(\’\”Parm1 value\” \”Parm 2 value\”\’)
OUTFILE(MONOSTDOUT)
MONOPATH(\’/QOpenSys/pkgs/bin\’)
DSPSTDOUT(*NO)
LOGSTDOUT(*YES)
PRTSTDOUT(*NO)
DLTSTDOUT(*YES)

MONO2 command parms

WORKDIR – The IFS location for the .Net program you want to call.

EXEFILE – The .Net program you want to call.

ARGS – Command line parameters. A single command line string where each parameter is delimited by double quotes. The double quotes are automatically removed by the .Net program when it processes the arguments. Ex: \’\”My Parm Value1\” \”My Parm Value2\”\’ Notice the entire command line value is surrounded by single quotes and each parm is delimited with double quotes.

OUTFILE – The output file which will receive STDOUT lokking feedback.

MONOPATH – This is the location of the Mono binary executable. The mono executable runs your .Net program code.
Specify /QOpenSys/pkgs/bin if you loaded Mono via the Yum repository. (Default)
Specify /opt/mono/bin if you loaded Mono via the save file from the following link: https://gith***ub.com/MonoOni/binarydist

DSPSTDOUT – Display the outfile contents. Nice when debigging.

LOGSTDOUT – Place STDOUT log entries into the current jobs job log. Use this if you want the log info in the IBM i joblog.

PRTSTDOUT – Print STDOUT to a spool file. Use this if you want a spool file of the log output.

DLTSTDOUT – This option insures that the STDOUT IFS temp files get cleaned up after processing. All IFS log files get created in the /tmp/mono directory.

下载源码

通过命令行克隆项目:

git clone https://github.com/richardschoen/MonoOniLibrary.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 编程相关 MonoOniLibrary https://www.zuozi.net/33161.html

docusaurus
上一篇: docusaurus
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务