Kpm 恢复失败并出现空参数异常

Kpm restore fails with null argument exception

我在 CentOs 6、CentOs 7 和 Ubuntu 12.04 上尝试了以下操作,结果都相同:

yum update -y
yum install  git wget unzip -y
yum install glib2-devel libpng-devel libjpeg-devel giflib-devel libtiff-devel libX11-devel fontconfig-devel bison gettext libtool cairo-devel gcc-c++ -y

cd /usr/local/src
git clone git://github.com/mono/mono.git
cd mono
./autogen.sh --prefix=/usr/local
sudo make get-monolite-latest
make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/basic.exe 
make install

curl -sSL https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.sh | sh && source ~/.kre/kvm/kvm.sh
chmod a+x /root/.kre/kvm/kvm.sh 
source /root/.kre/kvm/kvm.sh
kvm upgrade


CERTMGR=/usr/local/bin/certmgr
sudo $CERTMGR -ssl -m https://go.microsoft.com
sudo $CERTMGR -ssl -m https://nugetgallery.blob.core.windows.net
sudo $CERTMGR -ssl -m https://nuget.org
mozroots --import --sync

cd /usr/local/src
git clone https://github.com/aspnet/home
cd home/samples/HelloMvc/
kpm restore

我收到这个错误:

Restoring packages for ----------
System.ArgumentNullException: Argument cannot be null.
Parameter name: format
  at System.ParameterizedStrings.Evaluate (System.String format, FormatParam[] args) [0x00000] in <filename unknown>:0 
  at System.TermInfoDriver.ChangeColor (System.String format, ConsoleColor color) [0x00000] in <filename unknown>:0 
  at System.TermInfoDriver.set_ForegroundColor (ConsoleColor value) [0x00000] in <filename unknown>:0 
  at System.ConsoleDriver.set_ForegroundColor (ConsoleColor value) [0x00000] in <filename unknown>:0 
  at System.Console.set_ForegroundColor (ConsoleColor value) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.Runtime.Common.CommandLine.AnsiConsole.SetBold (Boolean bold) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.Runtime.Common.CommandLine.AnsiConsole.WriteLine (System.String message) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.Report.WriteLine (System.String message) [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<RestoreForProject>d__1.MoveNext () [0x00000] in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Boolean].GetResult () [0x00000] in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<ExecuteCommand>d__1.MoveNext () [0x00000] in <filename unknown>:0 
----------
Restore failed
Argument cannot be null.
Parameter name: format

谢谢!

编辑:另一次尝试通过 yum 安装产生了同样的错误。全新安装:

    1  yum update -y
    2  yum install wget git curl unzip -y
    3  yum install yum-utils -y
    4  rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
    5  yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
    6  yum search mono-complete
    7  yum install mono-complete
    8  yum update
    9  echo CERTMGR=$CERTMGR
   10  CERTMGR=/usr/local/bin/certmgr
   11  CERTMGR=/usr/bin/certmgr
   12  echo CERTMGR=$CERTMGR
   13  $CERTMGR -ssl -m https://go.microsoft.com
   14  yes | $CERTMGR -ssl -m https://nugetgallery.blob.core.windows.net
   15  yes | $CERTMGR -ssl -m https://nuget.org
   16  yes | $CERTMGR -ssl -m https://www.myget.org/F/aspnetvnext/
   17  mozroots --import --sync
   18  curl https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.sh | sh && source ~/.kre/kvm/kvm.sh
   19  chmod a+x /root/.kre/kvm/kvm.sh
   20  source /root/.kre/kvm/kvm.sh
   21  kvm upgrade
   22  cd /usr/local/src
   23  git clone https://github.com/aspnet/home
   24  cd home/samples/HelloMvc/
   25  ls
   26  kpm restore

另见 KRuntime bug

产生错误的是 Mono 的控制台实现。 setfgcolor is obviously null, so reading from one of the possible TermInfoReaders 失败。

我会说这是 Mono 错误或 Mono/CentOS 不兼容或丢失数据包。

您可以检查 the TERMINFO environment variable, or set the TERM environment variable 以明确选择 TermInfoReader。

将 TERM 设置为 dumb 会禁用整个输出并且一切正常。