Kpm恢复因null参数异常而失败

时间:2015-01-06 18:57:05

标签: mono kvm asp.net-core asp.net-core-mvc

我在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

1 个答案:

答案 0 :(得分:1)

另请参阅KRuntime bug

创建错误的原因是Mono的控制台实施。 setfgcolor显然是null,因此其中一个readingpossible TermInfoReaders失败。

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

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

将TERM设置为dumb将禁用整个输出,并且eveything可以正常工作。