【问题标题】:Can't run the .NET core default app无法运行 .NET 核心默认应用
【发布时间】:2016-05-31 04:13:23
【问题描述】:

我按照https://dotnet.github.io/getting-started/ 上的说明进行操作 我在 Windows 8.1 上安装了 .NET Core 并在一个空文件夹中执行:

dotnet new
dotnet restore
dotnet run

软件包已下载,应用程序已编译,但执行结束时出现异常。

未处理的异常:System.IO.FileNotFoundException:无法加载 文件或程序集 'System.Runtime, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其依赖项之一。

可能是什么问题?

【问题讨论】:

    标签: .net .net-core coreclr


    【解决方案1】:

    我尝试在我的 Windows 8.1 上重现,它可以正常工作。

    您使用的是哪个版本的 dotnet cli(运行 dotnet --version)?最新的安装程序可以找到here

    您也可以尝试在启用详细输出的情况下运行:dotnet --verbose run

    我的(工作)输出如下。你能看出有什么不同吗?

    Running C:\Program Files\dotnet\bin\dotnet-build.exe "--output" "C:\Projects\temp\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614" "--temp-output
    " "C:\Projects\temp\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614" "--framework" "DNXCore,Version=v5.0" "--configuration" "Debug" "C:\Projects\
    temp"
    Process ID: 21564
    Project temp (DNXCore,Version=v5.0) will be compiled because expected outputs are missing.
     C:\Projects\temp\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614\Debug\dnxcore50\temp.dll
     C:\Projects\temp\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614\Debug\dnxcore50\temp.pdb
    
    Running C:\Program Files\dotnet\bin\dotnet-compile.exe "--framework" "DNXCore,Version=v5.0" "--configuration" "Debug" "--output" "C:\Projects\tem
    p\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614" "--temp-output" "C:\Projects\temp\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614" "C:\Project
    s\temp"
    Process ID: 12284
    Compiling temp for DNXCore,Version=v5.0
    Running C:\Program Files\dotnet\bin\dotnet-compile-csc.exe "@C:\Projects\temp\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614\dotnet-compile.rsp"
    
    Process ID: 17832
    Running C:\Program Files\dotnet\bin\csc.exe "-noconfig" "@C:\Projects\temp\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614\dotnet-compile-csc.rsp
    "
    Process ID: 3936
    C:\Projects\temp\project.json(8,32): warning NU1007: Dependency specified was NETStandard.Library >= 1.0.0-rc2-23727 but ended up with NETStandar
    d.Library 1.0.0-rc2-23804.
    
    Compilation succeeded.
        1 Warning(s)
        0 Error(s)
    
    Time elapsed 00:00:04.5670414
    
    
    Running C:\Projects\temp\bin\.dotnetrun\d2d6b16263e145a0aa7245c62ff19614\Debug\dnxcore50\temp.exe
    Process ID: 7480
    Hello World!
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 2018-04-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-14
      • 2018-06-30
      • 1970-01-01
      相关资源
      最近更新 更多