试用Visual Studio Online-使用云来管理和编译代码真是太神奇了

本文介绍了作者试用Visual Studio Online的体验,这是一个在预览阶段的云端开发工具。通过浏览器、VS Code和Visual Studio,开发者可以轻松管理和编译代码。文章强调了在云端进行开发的优势,如在轻量级环境中使用IntelliCode和C#扩展,以及在不同设备上无缝切换开发环境。此外,作者还探讨了在VS Online中连接SSH目标、Docker容器和WSL的可能性。
摘要由CSDN通过智能技术生成

Visual Studio Online was announced in preview, so I wanted to try it out. I already dig the Visual Studio "Remote" technology (it's almost impossibly amazing) so moving the local container or WSL to the Cloud makes a lot of sense. Check out their blog post here.

Visual Studio Online已在预览中宣布,因此我想尝试一下。 我已经研究过Visual Studio的“远程”技术(这几乎是不可能的),因此将本地容器或WSL迁移到云端非常有意义。 在此处查看他们的博客文章

There's three quick starts.

有三个快速入门。

Sweet. I'll start with with Browser version, which is the easiest one I'm guessing. I head to the login page. I'm using the new Edge browser.

甜。 我将从浏览器版本开始,这是我猜到的最简单的版本。 我进入登录页面。 我正在使用新的Edge浏览器

I see this page that says I have no "environments" set up.

我看到此页面说我没有设置“环境”。

VS Online for the Browser

I'll make a plan. I changed mine to fall asleep (suspend) in 5 minutes, but the default is 30. Pricing is here.

我会制定一个计划。 我将我的睡眠时间更改为在5分钟内进入Hibernate状态,但默认设置为30。定价在这里

Now it's making my environment.

现在,这就是我的环境。

Sweet. VS Online

I clicked on it. Then opened a new Terminal, ran "dotnet new web" and I'm basically in a thin VS Code, except in the browser. I've got intellicode, I can install the C# extension.

我点击了它。 然后打开一个新的终端,运行“ dotnet new web”,除了浏览器外,我基本上是在VS Code中运行。 我有intellellicode,可以安装C#扩展名。

I'm in VS Code but it's not, it's VS Online in a browser

Since I'm running a .NET app I had to run these commands in a new terminal to generate and trust certs for SSL.

由于我正在运行.NET应用程序,因此必须在新终端中运行这些命令才能生成和信任SSL证书。

dotnet dev-certs https
dotnet dev-certs https -- trust

Then I hit the Debug menu to build and compile my app IN THE CLOUD and I get "connecting to the forwarded port" as its "localhost" is in the cloud.

然后,我点击Debug菜单在CLOUD中构建和编译我的应用程序,并且由于其“ localhost”在云中,因此我得到了“连接到转发端口”的信息。

Connecting to the forwarded port

Now I've hit a breakpoint! That's bonkers.

现在我已经达到了断点! 那是傻瓜。

Hello World IN THE CLOUD

Now to try it in VS Code rather than online in the browser. I installed the Visual Studio Online extention and clicked on the little Remote Environment thing on the left side after running VS Code.

现在在VS Code中尝试,而不是在浏览器中在线尝试。 我安装了Visual Studio Online扩展,并在运行VS Code之后单击左侧的“远程环境”小东西。

This is amazing. Look on the left side there. You can see my Raspberry PI as an SSH target. You can see my new VS Online Plan, you can see my Docker Containers because I'm running Docker for Windows, you can see my WSL Targets as I've got multiple local Linuxes.

这真太了不起了。 在左侧看。 您可以将我的Raspberry PI作为SSH目标。 您可以看到我的新VS Online计划,可以看到我的Docker容器,因为我正在运行Windows的Docker,可以看到我的WSL目标,因为我有多个本地Linux。

Since I'm running currently in VS Online (see the HanselmanTestPlan1 in the lower corner in green) I can just hit F5 and it compiles and runs.

由于我当前正在VS Online中运行(请参见绿色下角的HanselmanTestPlan1),我可以按F5键,然后编译并运行。

It's a client-server app. VS Code is doing some of the work, but the heavy lifting is in the cloud. Same as if I split the work between Windows and WSL locally, in this case VS Code is talking to that 8 gig Linux Environment I made earlier.

这是一个客户端服务器应用程序。 VS Code正在做一些工作,但是繁重的工作在云端。 就像我在Windows和WSL之间本地分割工作一样,在这种情况下,VS Code正在与我之前制作的8 gig Linux环境进行通信。

VS Code attached to VS Online

When I hit localhost:500x it's forwarded up to the cloud:

当我点击localhost:500x时,它被转发到云中:

Port forwarding

Amazing. Now I can do dev on a little cheapo laptop but have a major server to the work in the cloud. I can then head over to https://online.visualstudio.com/environments and delete it, or I can let it suspend.

惊人。 现在,我可以在一台便宜的笔记本电脑上进行开发,但可以在云中使用一台主要的服务器来工作。 然后,我可以转到https://online.visualstudio.com/environments并删除它,也可以暂停它。

Suspending a VS Online Environment

I'm going to continue to explore this and see if I can open my blog and podcast sites in this world. Then I can open and develop on them from anywhere. Or soon from my iPad Pro!

我将继续探索这一点,看看是否可以在这个世界上打开我的博客和播客网站。 然后,我可以从任何地方打开和开发它们。 或很快从我的iPad Pro上来!

Go give Visual Studio Online a try. It's Preview but it's lovely.

试试看Visual Studio Online 。 它是Preview,但是很可爱。

Sponsor: Like C#? We do too! That’s why we've developed a fast, smart, cross-platform .NET IDE which gives you even more coding power. Clever code analysis, rich code completion, instant search and navigation, an advanced debugger... With JetBrains Rider, everything you need is at your fingertips. Code C# at the speed of thought on Linux, Mac, or Windows. Try JetBrains Rider today!

发起人:喜欢C#吗? 我们也这样做! 这就是为什么我们开发了一个快速,智能,跨平台的.NET IDE的原因,它为您提供了更多的编码能力。 巧妙的代码分析,丰富的代码完成,即时搜索和导航,高级调试器...使用JetBrains Rider,您所需的一切都唾手可得。 在Linux,Mac或Windows上以思考的速度编写C#代码。 立即尝试JetBrains Rider

翻译自: https://www.hanselman.com/blog/trying-out-visual-studio-online-using-the-cloud-to-manage-and-compile-your-code-is-amazing

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值