可以把对应的包名都加上!The package mono - devel should be installed to

时间:2021-10-26 09:17:41

一:安置Mono,此法式参照官网

1:配置Yum货仓

#Centos 7
yum
install yum-utils rpm --import "?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" yum-config-manager --add-repo http://download.mono-project.com/repo/centos7/

#Centos 6 yum install yum-utils rpm --import "?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF" yum-config-manager --add-repo http://download.mono-project.com/repo/centos6/

2:安置mono

yum install mono-devel #这里面是官网的安置说明,一般情况下安置devel就可以了!,安置所有,可以把对应的包名都加上! The package mono-devel should be installed to compile code. The package mono-complete should be installed to install everything - this should cover most cases of "assembly not found" errors. The package referenceassemblies-pcl should be installed for PCL compilation support - this will resolve most cases of "Framework not installed: .NETPortable" errors during software compilation. The package xsp should be installed for running ASP.NET applications.

二:配置windows措施的开机启动项

1: vim /etc/init.d/mfgRemotingServer,并输入以下内容


#!/bin/bash # #chkconfig: 2345 20 80 #description:remotingservice start() {
#这里面的-l是指定lock文件,后面跟的是exe措施地址的绝对路径,可以通过mono-service命令检察辅佐 mono
-service -l:/root/remotingservice-lock /home/setquestion/Mfg.Setquestion.RemotingServer.exe } stop() { kill `cat /root/remotingservice-lock` } case "$1" in start) start ;; stop) stop ;; restart) stop start ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 esac

2:执行时service mfgRemotingServer stop 会遇到  env: /etc/init.d/mfgRemotingServer: Permission denied,解决步伐如下:

chmod +x /etc/init.d/mfgRemotingServer service mfgRemotingServer stop #插手到开机启动项 chkconfig --add mfgRemotingServer chkconfig mfgRemotingServer on

3:mono-service的相关参数如下:

You must specify at least the assembly name Usage is: /usr/bin/mono-service [options] service -d:<directory> Working directory -l:<lock file> Lock file (default is /tmp/<service>.lock) -m:<syslog name> Name to show in syslog -n:<service name> Name of service to start (default is first defined) --debug Do not send to background nor redirect input/output --no-daemon Do not send to background nor redirect input/output Controlling the service: kill -USR1 `cat <lock file>` Pausing service kill -USR2 `cat <lock file>` Continuing service kill `cat <lock file>` Ending service

PS:如果给为在安置和配置过程中有任何疑问,望留言。

Centos下安置最新版Mono并为windwos处事配置开机启动项