简体   繁体   English

是否可以将Visual Studio 2017设置为在远程Linux机器而不是本地机器上运行和调试.NET Core C#应用程序?

[英]Is it possible to setup Visual Studio 2017 such that it runs and debugs a .NET Core C# application on remote Linux machine instead of local machine?

My scenario is that I have Visual Studio 2017 running on Windows and all the sources are stored locally on the same Windows machine and I want that code to be shipped to a remote Linux machine, compiled there, run there and remote debugged there. 我的情况是,我在Windows上运行了Visual Studio 2017,并且所有源代码都本地存储在同一Windows机器上,并且我希望将该代码运送到远程Linux机器上,在此处编译,在此处运行并在那里进行远程调试。

With proper configuration I can create a CMake C++ project and have it run and remote debugged on remote Linux machine right out of the box. 通过正确的配置,我可以立即创建一个CMake C ++项目,并在远程Linux机器上运行它并进行远程调试。 Can I have the same for a .NET Core project with C# code? 对于使用C#代码的.NET Core项目,我可以使用相同的名称吗?

I found this question which implies that I could run dotnet publish and maybe also use "attach to process" then but that doesn't look a straightforward as just selecting a startup item and clicking "Play" in a CMake project. 我发现了这个问题 ,这意味着我可以运行dotnet publish然后也可以使用“附加进行处理”,但这看起来并不简单,就像在CMake项目中选择启动项并单击“播放”一样。

Can I have the same experience of remote starting and debugging my C# code on remote Linux machine as it works in case of CMake C++ projects in Visual Studio 2017? 我可以像在Visual Studio 2017中的CMake C ++项目中一样具有在远程Linux机器上远程启动和调试C#代码的经验吗?

Can I have the same experience of remote starting and debugging my C# code on remote Linux machine as it works in case of CMake C++ projects in Visual Studio 2017? 我可以像在Visual Studio 2017中的CMake C ++项目中一样具有在远程Linux机器上远程启动和调试C#代码的经验吗?

I'm afraid the answer is negative. 恐怕答案是否定的。 For now, the remote-debugging experience in Linux for .net core is quite different from that for C++ . 目前, Linux.net core的远程调试体验与C++完全不同。 It would be a bit more complex when configuring remote debugging in Linux for .net core projects. 在Linux中为.net核心项目配置远程调试时,这会有些复杂。

You can't simply select the startup item and click "play" like what you did in CMake C++ projects. 您不能像在CMake C ++项目中那样简单地选择启动项并单击“播放”。

Instead you do need to configure the Attach to Process in VS after you start the .net core application in Linux .( dotnet publish command is not necessary, you can use the Publish option in VS, and then copy the output publish directory to a directory with execute permission on the Linux Test VM ) 相反,在Linux中启动.net核心应用程序后,您确实需要在VS中配置“ Attach to Process 。(不需要dotnet publish命令,可以在VS中使用Publish选项,然后将输出的publish目录复制到目录中在Linux测试VM上具有执行权限

Assuming the .net core you mentioned above indicates asp.net core , please check Debugging ASP Core on Linux with Visual Studio 2017 for more details about how to configure the environment to get a start. 假设您上面提到的.net core表示asp.net core ,请检查使用Visual Studio 2017在Linux上调试ASP核心,以获取有关如何配置环境以开始的更多详细信息。 Hope it helps :) 希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将Visual Studio Community 2017 Asp.Net Core 2项目部署到远程IIS计算机 - Deploy a Visual Studio Community 2017 Asp.Net Core 2 project to remote IIS machine 是否可以使用Windows中的Visual Studio连接到远程Linux机器中的MySQL数据库 - Is it possible to connect to MySQL database in a remote Linux machine with Visual Studio in Windows Visual Studio 2010 C#在远程计算机上运行/调试 - Visual Studio 2010 C# Run/Debug on Remote Machine Visual Studio 在本地机器上运行,服务器的 IP - Visual Studio runs on local machine with server's IP 使用 Visual Studio 在我的本地计算机上设置测试环境 - Setup a test environment on my local machine using Visual Studio 将新 .NET CORE 加载到 Visual Studio 2017 c# .NET CORE 项目中的问题 - Problem of loading new .NET CORE into Visual Studio 2017 c# .NET CORE project 访问仅在本地计算机上运行的ASP.NET Web应用程序 - Accessing ASP.NET web application that only runs on a local machine 远程部署/调试 Visual Studio 2017 .NET Core - Remote deploy/debug Visual Studio 2017 .NET Core 如何从c#应用程序获得远程linux机器的cpu和ram使用 - How can I get cpu and ram usage of remote linux machine from c# application 无需在远程计算机上安装Visual Studio,就可以在dll中远程执行C#单元测试 - Execute C# unit Tests in dll remotely without installing Visual Studio on remote machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM