try catch 全局_Try .NET全局工具简介-浏览器中的交互式文档和研讨会创建者

try catch 全局_Try .NET全局工具简介-浏览器中的交互式文档和研讨会创建者_第1张图片

try catch 全局

try catch 全局_Try .NET全局工具简介-浏览器中的交互式文档和研讨会创建者_第2张图片

If you find yourself learning C# and .NET and come upon the "Run your first C# Program" documentation you may have noticed a "Try the code in your browser" button that lets you work through your first app entirely online, with no local installation! You're running C# and .NET in the browser! It's a great way to learn that is familiar to folks who learn JavaScript.

如果您发现自己学习C#和.NET,并且遇到了“运行您的第一个C#程序”文档,则可能已经注意到“尝试在浏览器中使用代码”按钮,该按钮使您可以完全在线运行第一个应用程序,而无需本地安装! 您正在浏览器中运行C#和.NET! 这是学习JavaScript的人所熟悉的一种很好的学习方式。

The language team at Microsoft wants to bring that easy on-ramp to everyone who wants to learn .NET.

微软的语言团队希望为所有想学习.NET的人带来轻松的入门。

The .NET Foundation has published a lot of free .NET presentations and workshops that you can use today to teach open source .NET to your friends, colleagues, or students. However these do encourage you to install a number of prerequisites and we believe that there might be an easier on-ramp to learning .NET.

.NET基金会已经发布了许多免费的.NET演示文稿和讲习班,您现在可以使用它们来向您的朋友,同事或学生教开源.NET。 但是,这些建议确实鼓励您安装一些先决条件,并且我们相信,学习.NET可能会更容易。

Today we're announcing that on ramp - the Try .NET global tool!

今天我们在斜面发布-Try .NET全局工具

Here's the experience. Once you have the .NET SDK - Pick the one that says you want to "Build Apps." Just get the "try" tool! Try it!

这就是经验。 拥有.NET SDK之后,请选择一个您要“构建应用程序”的选项。 只需获取“试用”工具! 试试吧!

  • Open a terminal/command prompt and type dotnet tool install --global dotnet-try

    打开终端/命令提示符,然后键入dotnet工具install --global dotnet-try

Now you can either navigate to an empty folder and type

现在,您可以导航到一个空文件夹并输入

dotnet try demo

dotnet试用

or, even better, do this!

或者,甚至更好地做到这一点!

ACTION: Clone the samples repo with git clone https://github.com/dotnet/try -b samples then run "dotnet try" and that's it!

操作:使用git clone https://github.com/dotnet/try -b样本克隆样本回购,然后运行“ dotnet try ”,就是这样!

NOTE: Make sure you get the samples branch until we have more samples!

注意:确保您拥有样品分支,直到我们有更多样品为止!

C:\Users\scott\Desktop> git clone https://github.com/dotnet/try -b samples
Cloning into 'try'...
C:\Users\scott\Desktop> cd .\try\Samples\
C:\Users\scott\Desktop\try\Samples [samples ≡]> dotnet try
Hosting environment: Production
Content root path: C:\Users\scott\Desktop\try\Samples
Now listening on: http://localhost:5000
Now listening on: https://localhost:5001

Your browser will pop up and you're inside a local interactive workshop! Notice the URL? You're browsing your *.md files and the code inside is runnable. It's all local to you! You can put this on a USB key and learn offline or in disconnected scenarios which is great for folks in developing countries. Take workshops home and remix! Run an entire workshop in the browser and the setup instructions for the room is basically "get this repository" and type "dotnet try!"

您的浏览器将会弹出,并且您在本地的交互式研讨会中! 注意到网址了吗? 您正在浏览* .md文件,并且其中的代码可运行。 对您来说都是本地的! 您可以将其放在USB闪存盘上,并离线或在断开连接的情况下进行学习,这对发展中国家的人们非常有用。 带上讲习班回家并混音! 在浏览器中运行整个研讨会,会议室的设置说明基本上是“获取此存储库”,然后键入“ dotnet try!”。

try catch 全局_Try .NET全局工具简介-浏览器中的交互式文档和研讨会创建者_第3张图片

This is not just a gentle on-ramp that teaches .NET without yet installing Visual Studio, but it also is a toolkit for you to light up your own Markdown.

这不仅是在没有安装Visual Studio的情况下教授.NET的轻巧入门,它还是一个用于点亮自己的Markdown的工具包。

Just add a code fence - you may already be doing this! Note the named --region there? It's not actually running the visible code in the Markdown...it's not enough! It's compiling your app and capturing the result of the named region in your source! You could even make an entire .NET interactive online book.

只需添加一个代码围栏-您可能已经在这样做了! 注意命名的--region吗? 它实际上并没有在Markdown中运行可见代码……这还不够! 它正在编译您的应用程序并捕获源中命名区域的结果! 您甚至可以制作一整个.NET交互式在线书。

### Methods
A **method** is a block of code that implements some action. `ToUpper()` is a method you can invoke on a string, like the *name* variable. It will return the same string, converted to uppercase.
``` cs --region methods --source-file .\myapp\Program.cs --project .\myapp\myapp.csproj
var name = "Friends";
Console.WriteLine($"Hello {name.ToUpper()}!");
```

And my app's code might look like:

我的应用程序代码可能类似于:

using System;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
#region methods
var name = "Friends"
Console.WriteLine($"Hello {name.ToUpper()}!");
#endregion
}
}
}

Make sense?

有道理?

NOTE: Closing code fences ``` must be on a newline.

注意:关闭代码分隔符```必须在换行符上。

Hey you! YOU have some markdown or just a readme.md in your project! Can you light it up and make a workshop for folks to TRY your project?

嘿,你! 您的项目中有一些markdown或只有一个readme.md! 您能点亮它并为人们制作一个工作坊来尝试您的项目吗?

try catch 全局_Try .NET全局工具简介-浏览器中的交互式文档和研讨会创建者_第4张图片

Here I've typed "dotnet try verify" to validate my markdown and ensure my samples compile. Dotnet Try is both a runner and a creator's toolkit.

在这里,我输入了“ dotnet try verify”来验证我的降价并确保我的样本可以编译。 Dotnet Try既是跑步者是创建者的工具包

try catch 全局_Try .NET全局工具简介-浏览器中的交互式文档和研讨会创建者_第5张图片

Today "dotnet try" uses .NET Core 2.1 but if you have .NET Core 3 installed you can explore the more complex C# samples here with even more interesting and sophisticated presentations. You'll note in the markdown the --session argument for the code fence allows for interesting scenarios where more than one editor runs in the context of one operation!

今天,“ dotnet试用”使用.NET Core 2.1,但是如果您安装了.NET Core 3,则可以在此处探索更复杂的C#示例,并提供更有趣和更精致的演示。 您会在markdown中注意到代码围栏的--session参数允许有趣的场景,其中在一个操作的上下文中运行多个编辑器!

try catch 全局_Try .NET全局工具简介-浏览器中的交互式文档和研讨会创建者_第6张图片

I'd love to see YOU create workshops with Try .NET. It's early days and this is an Alpha release but we think it's got a lot of promise. Try installing it and running it now and later head over to https://github.com/dotnet/try to file issues if you find something or have an idea.

我希望看到您使用Try .NET创建研讨会。 现在还处于初期,这是Alpha版本,但我们认为它有很多希望。 尝试安装并立即运行它,然后在发现或有想法的情况下转到https://github.com/dotnet/尝试提交问题。

Go install "dotnet try" locally now, and remember this is actively being developed so you can update it easily and often like this!

立即在本地安装“ dotnet try”,并记住它正在积极开发中,因此您可以轻松地经常更新它!

dotnet tool update -g dotnet-try

There's lots of ideas planned, as well as the ability to publish your local workshop as an online one with Blazor and WASM. Here's a live example.

计划中有很多想法,并且可以与Blazor和WASM在线发布本地研讨会。 这是一个生动的例子。

Watch for an much more in-depth post from Maria from my team on Thursday on the .NET blog!

周四在.NET博客上观看我团队中Maria的更深入的文章!

翻译自: https://www.hanselman.com/blog/introducing-the-try-net-global-tool-interactive-inbrowser-documentation-and-workshop-creator

try catch 全局

你可能感兴趣的:(python,java,编程语言,github,人工智能)