代码之家  ›  专栏  ›  技术社区  ›  Tjaart

安装引用程序集Ubuntu 18.04后出现Mono MSBuild错误

  •  1
  • Tjaart  · 技术社区  · 7 年前

    我想在Ubuntu18.04上用Mono构建一个.NETFramework4.7.2项目

    https://www.mono-project.com/download/stable/

    在我的一个项目上安装并尝试运行msbuild后,出现以下错误:

    /usr/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(1195,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.7.2" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. 
    

    mono-reference-assemblies-4.0

    安装包并再次运行构建后,我收到以下错误:

    MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
    System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
    File name: 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
      at Microsoft.Build.Shared.BuildEnvironmentHelper.get_Instance () [0x00017] in <0fd2831d9cb34830af9027441f77a417>:0 
      at Microsoft.Build.Utilities.Traits.get_Instance () [0x00000] in <0fd2831d9cb34830af9027441f77a417>:0 
      at Microsoft.Build.CommandLine.MSBuildApp.Execute (System.String commandLine) [0x000bb] in <0fd2831d9cb34830af9027441f77a417>:0 
    
    Unhandled Exception:
    System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
    File name: 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
      at Microsoft.Build.Shared.BuildEnvironmentHelper.get_Instance () [0x00017] in <0fd2831d9cb34830af9027441f77a417>:0 
      at Microsoft.Build.Utilities.Traits.get_Instance () [0x00000] in <0fd2831d9cb34830af9027441f77a417>:0 
      at Microsoft.Build.CommandLine.MSBuildApp.Execute (System.String commandLine) [0x003f2] in <0fd2831d9cb34830af9027441f77a417>:0 
      at Microsoft.Build.CommandLine.MSBuildApp.Main () [0x00028] in <0fd2831d9cb34830af9027441f77a417>:0 
    [ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
    File name: 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
      at Microsoft.Build.Shared.BuildEnvironmentHelper.get_Instance () [0x00017] in <0fd2831d9cb34830af9027441f77a417>:0 
      at Microsoft.Build.Utilities.Traits.get_Instance () [0x00000] in <0fd2831d9cb34830af9027441f77a417>:0 
      at Microsoft.Build.CommandLine.MSBuildApp.Execute (System.String commandLine) [0x003f2] in <0fd2831d9cb34830af9027441f77a417>:0 
      at Microsoft.Build.CommandLine.MSBuildApp.Main () [0x00028] in <0fd2831d9cb34830af9027441f77a417>:0 
    

    无论我在哪里运行,都会发生此错误 msbuild

    任何帮助都将不胜感激。

    1 回复  |  直到 7 年前
        1
  •  1
  •   knocte    7 年前

    mono-reference-assemblies-4.0 包装并非来自新产品的稳定渠道 apt