在Mac和Windows上打开相同的.NET Core解决方案

编程入门 行业动态 更新时间:2024-10-25 19:30:22
本文介绍了在Mac和Windows上打开相同的.NET Core解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我注意到在Visual Studio 2015中创建的.NET Core项目与在Mac中使用 dotnet new 创建的.NET Core项目之间存在差异。

考虑到VS Code与VS 2015显然不同,是否可以同时使用Mac和Windows机器在同一.NET Core解决方案上工作,或者根本上是该解决方案/项目?由于VS 2015需要.sln和.xproj而有所不同?

解决方案

这应该可以正常工作!我已经使用Visual Studio 2015在Windows上成功启动了.NET Core项目,并在Mac上使用Visual Studio Code 1.3+继续了它们。

Visual Studio添加了诸如 .sln 和 .xproj ,但是Visual Studio Code会很乐意忽略它们。要使Visual Studio代码能够识别我的解决方案,我要做的唯一一件事是:

  • 我首先必须单击状态栏中的提示以启用C#支持。一旦这样做,它就可以识别解决方案中的所有项目。

    I've noticed differences between a .NET Core project created in Visual Studio 2015 and a .NET Core project created using dotnet new in Mac.

    Considering that VS Code is obviously not the same than VS 2015, is it possible to work on the same .NET Core solution using both a Mac and a Windows machine or are the solutions/projects fundamentally different due to the .sln and .xproj needed in VS 2015?

    解决方案

    This should work fine! I've successfully started .NET Core projects on Windows with Visual Studio 2015 and continued them on my Mac with Visual Studio Code 1.3+.

    Visual Studio adds extra files like .sln and .xproj, but Visual Studio Code will happily ignore them. The only thing I had to do to get Visual Studio Code to recognize my solution was:

    • Install the C# extension from Microsoft
    • Open the root solution folder in Visual Studio Code
    • Open a code file somewhere in the project and check the lower-right status bar:

    I first had to click a prompt in the status bar to enable C# support. Once I did that, it recognized all the projects in my solution.

更多推荐

在Mac和Windows上打开相同的.NET Core解决方案

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

发布评论

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

>www.elefans.com

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