gpt4 book ai didi

asp.net - 尝试在 Ubuntu 上运行新创建的 ASP.NET vNext 项目但出现错误

转载 作者:行者123 更新时间:2023-12-04 18:28:30 27 4
gpt4 key购买 nike

我想尝试新的 ASP.NET 5(也称为 vNext?),所以我下载了 ubuntu-14.04.2-server-amd64.iso,安装在 VMware Player 中并运行。

安装后,我运行以下命令:

  • sudo apt-get 更新
  • sudo apt-get 升级
  • sudo apt-get install nodejs-legacy npm
  • sudo npm install -g gulp
  • sudo npm install -g bower

  • 引用 https://github.com/aspnet/home ,我按照以下步骤操作:
  • 获取单声道
  • 获取 libuv
  • 获取 DNVM
  • 将源添加到 NuGet.config

  • 然后我创建一个 ASP.NET 项目,在“ASP.NET 5 Preview Template”(Visual Studio Community 2015 RC)中选择“Web site”。我将整个项目文件夹上传到在 VMware Player 中运行的 ubuntu 服务器。

    只需再次执行以下步骤:
  • cd 到项目文件夹
  • dnu 恢复

  • (download and install ...) Writing lock file /home/ubuntu/vNext/WebApplication1/src/WebApplication1/project.lock.json npm WARN package.json ASP.NET@0.0.0 No description npm WARN package.json ASP.NET@0.0.0 No repository field. npm WARN package.json ASP.NET@0.0.0 No README data [18:04:44] Warning: gulp version mismatch: [18:04:44] Global gulp is 3.9.0 [18:04:44] Local gulp is 3.8.11 [18:04:44] Using gulpfile ~/vNext/WebApplication1/src/WebApplication1/gulpfile.js [18:04:44] Starting 'clean'... [18:04:44] Finished 'clean' after 5.43 ms [18:04:44] Starting 'copy'... [18:04:44] Finished 'copy' after 16 ms Restore complete, 217628ms elapsed


  • dnx红隼

  • System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1': EntityFramework.Commands 7.0.0-beta4 EntityFramework.SqlServer 7.0.0-beta4 Microsoft.AspNet.Authentication.Cookies 1.0.0-beta4 Microsoft.AspNet.Authentication.Facebook 1.0.0-beta4 Microsoft.AspNet.Authentication.Google 1.0.0-beta4 Microsoft.AspNet.Authentication.MicrosoftAccount 1.0.0-beta4 Microsoft.AspNet.Authentication.Twitter 1.0.0-beta4 Microsoft.AspNet.Diagnostics 1.0.0-beta4 Microsoft.AspNet.Diagnostics.Entity 7.0.0-beta4 Microsoft.AspNet.Identity.EntityFramework 3.0.0-beta4 Microsoft.AspNet.Mvc 6.0.0-beta4 Microsoft.AspNet.Mvc.TagHelpers 6.0.0-beta4 Microsoft.AspNet.Server.IIS 1.0.0-beta4 Microsoft.AspNet.Server.WebListener 1.0.0-beta4 Microsoft.AspNet.StaticFiles 1.0.0-beta4 Microsoft.AspNet.Tooling.Razor 1.0.0-beta4 Microsoft.Framework.CodeGenerators.Mvc 1.0.0-beta4 Microsoft.Framework.ConfigurationModel.Json 1.0.0-beta4 Microsoft.Framework.ConfigurationModel.UserSecrets 1.0.0-beta4 Microsoft.Framework.Logging 1.0.0-beta4 Microsoft.Framework.Logging.Console 1.0.0-beta4 Microsoft.VisualStudio.Web.BrowserLink.Loader 14.0.0-beta4 Searched Locations: /home/ubuntu/vNext/{name}/project.json /home/ubuntu/vNext/WebApplication1/src/{name}/project.json /home/ubuntu/vNext/WebApplication1/test/{name}/project.json /usr/lib/mono/4.5/{name}.dll /usr/lib/mono/4.5/Facades/{name}.dll Try running 'dnu restore'.

    at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in :0



    这里有错误

    我尝试在项目文件夹中运行“dnu restore -s https://www.myget.org/F/aspnetvnext/api/v2/”,但出现了一些其他错误
    (download and install ... )
    [17:48:08] Warning: gulp version mismatch:
    [17:48:08] Global gulp is 3.9.0
    [17:48:08] Local gulp is 3.8.11
    [17:48:08] Using gulpfile ~/vNext/WebApplication1/src/WebApplication1/gulpfile.js
    [17:48:08] Starting 'clean'...
    [17:48:08] Finished 'clean' after 2.25 ms
    [17:48:08] Starting 'copy'...
    [17:48:08] Finished 'copy' after 20 ms
    Restore complete, 358056ms elapsed
    Errors in `/home/ubuntu/vNext/WebApplication1/src/WebApplication1/project.json
    Unable to locate Microsoft.VisualStudio.Web.BrowserLink.Loader >= 14.0.0-beta4
    Unable to locate Newtonsoft.Json >= 6.0.6
    Unable to locate System.Collections.Immutable >= 1.1.36
    Unable to locate System.Reflection.Metadata >= 1.0.21
    Unable to locate Ix-Async >= 1.2.3
    Unable to locate Remotion.Linq >= 2.0.0-alpha-002

    所以,问题是,我做错了什么,还是 Visual Studio 2015 RC 创建的默认 ASP.NET vNext 项目无法在 Ubuntu(和其他 Linux 发行版)下运行?

    最佳答案

    我相信您的应用程序的目标是完整的 .NET 4.5.1 框架,该框架仅适用于 Windows。您可以将 DNX 与 .NET451 (Windows)、.NET Core(跨平台)和 Mono(跨平台)一起使用。

    尝试以 .NET Core 为目标。另一种选择是使用 Yeoman 以“Linux 方式”创建一个新项目。

    输出关键点:

    System.InvalidOperationException: Failed to resolve the following dependencies for target framework 'DNX,Version=v4.5.1'

    还有一些 IIS 引用资料:)
    Microsoft.AspNet.Server.IIS 1.0.0-beta4

    关于asp.net - 尝试在 Ubuntu 上运行新创建的 ASP.NET vNext 项目但出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30963397/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com