如何在Visual Studio 2017中打开dotnet

编程入门 行业动态 更新时间:2024-10-24 22:18:33
本文介绍了如何在Visual Studio 2017中打开dotnet-core CLI项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

为了学习两者,我一直在使用dotnet Core(用于API)和Angular2开发一个简单的应用程序。

I have been developing a simple application using dotnet Core (for an API) and Angular2 for the purpose of learning both.

我是在命令行上使用Yeoman创建的项目,并且一直在使用Visual Studio Code(在Windows上)愉快地编码。所有人似乎在一起很好,这是一种令人愉快的体验。

I created the project using Yeoman on the command line and have been happily coding away in Visual Studio Code (on Windows). All seems to hang together well and it's been an enjoyable experience.

我想我可以尝试Visual Studio 2017,看看一段时间内在VS中开发dotnet Core项目的经历是什么样的。

I thought I might try out Visual Studio 2017 and see what the experience of developing a dotnet Core project in VS is like for a while.

但是,安装了VS2017并从github克隆了项目后,我不确定如何继续。我看不到任何还原/构建/运行项目的方法。

克隆仓库后,我看到我的项目显示在解决方案资源管理器中,显示为project.json文件可见。但是,调试|开始显示为灰色。我在VS2017上读过一些文章,需要将project.json转换为新的(旧的?)XML格式,并且我感觉到我缺少.sln文件。

After cloning the repo, I see my project displayed in the Solution Explorer with the project.json file visible. However, Debug | Start is greyed out. I read somewhere about VS2017 needing to convert project.json to the new (old?) XML format and also I have a feeling I am missing a .sln file.

如果有人能指出我正确的方向,我将不胜感激。

I would appreciate it if someone could point me in the right direction.

推荐答案

如果您的项目中有 .xproj 文件

If your project has an .xproj file

  • 打开Visual Studio。
  • 文件>打开>项目/解决方案。
  • 为您的解决方案打开 xxx.xproj 。
  • Open Visual Studio.
  • File > Open > Project/Solution.
  • Open the xxx.xproj for your solution.
  • 如果您的项目缺少 .xproj 文件

    If your project lacks an .xproj file

  • 安装.NET Core SDK 预览3或更高版本。
  • 在项目目录中打开命令提示符。
  • 运行 dotnet迁移。
  • 打开生成的 .csproj
  • 在Visual Studio 2017中。
  • Install .NET Core SDK Preview 3 or higher.
  • Open a command prompt at your project's directory.
  • Run dotnet migrate.
  • Open the resulting .csproj in Visual Studio 2017.
  • 故障排除

    使用 dotnet migration -h 查看迁移帮助。

    如果您有 global.json 文件,请在运行 migrate之前更新其SDK版本。 。例如。

    If you have a global.json file, update its SDK version before running migrate. E.g.

    { "sdk": { "version": "1.0.0-preview4-004233" } }

    使用 dir'C:\Program Files\dotnet\sdk\'。

    更新Visual Studio 2017及其安装程序。在我的计算机上,以上内容适用于Microsoft Visual Studio Community 2017 RC版本 15.0.26014.0 D15REL 。

    Update Visual Studio 2017 and its installer. On my machine, the above works with Microsoft Visual Studio Community 2017 RC Version 15.0.26014.0 D15REL.

    Update。 NET Core SDK。在我的机器上,以上代码可用于SDK 1.0.0-preview4-004233 。

    Update .NET Core SDK. On my machine, the above works with SDK 1.0.0-preview4-004233.

    更多推荐

    如何在Visual Studio 2017中打开dotnet

    本文发布于:2023-11-15 23:44:36,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1599029.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:如何在   Visual   Studio   dotnet

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!