在Mac和Windows上打开相同的.NET Core解决方案 [英] Opening the same .NET Core solution on both Mac and Windows

查看:145
本文介绍了在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解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆