The .NET documentation contains a set of samples and tutorials that teach you about .NET. This article describes how to find, view, and download .NET, ASP.NET Core, and C# samples and tutorials. Find resources to learn the F# programming language on the F# Foundation's site. If you're interested in exploring C# using an online code editor, start with this interactive tutorial and continue with C# interactive tutorial. For instructions on how to view and download sample code, see the Viewing and downloading samples section.
This guide shows you how to create an ASP.NET Core web app and associated unit tests. It starts by creating a simple web service app and then adds tests. It continues with creating more tests to guide implementing new features. The completed sample is available in the dotnet/samples repository on GitHub.
This tutorial shows how to create and run a .NET console application by using Visual Studio Code and the .NET CLI. Project tasks, such as creating, compiling, and running a project are done by using the .NET CLI.
This tutorial shows how to write libraries for .NET using Visual Studio Code and the .NET CLI. Project tasks, such as creating, compiling, and running a project are done by using the .NET CLI.
This sample demonstrates the syntax and features for creating and consuming C# iterators. The completed sample is available in the dotnet/samples repository on GitHub.
This sample demonstrates the syntax and features for C# delegates and events. The completed sample is available in the dotnet/samples repository on GitHub. A second sample focused on events is also in the same repository.
This sample demonstrates many of the problems that can be solved by using Expression Trees. The completed sample is available in the dotnet/samples repository on GitHub.
LINQ Samples
This series of samples demonstrate many of the features of Language Integrated Query (LINQ). The completed sample is available in the dotnet/samples repository on GitHub.
Managed COM server Sample
The COM server sample demonstrates the creation of a managed COM server and how it can be globally registered or consumed via RegFree COM.
This tutorial demonstrates Console I/O, the structure of a console app, and the basics of the task-based asynchronous programming model. The completed sample is available in the dotnet/samples repository on GitHub.
This tutorial demonstrates web communications, JSON serialization, and object-oriented features of the C# language. The completed sample is available in the dotnet/samples repository on GitHub.
This tutorial demonstrates many of the features of LINQ and the language elements that support it. The completed sample is available in the dotnet/samples repository on GitHub.
This tutorial shows you how to build a simple application on .NET Core that supports a plugin architecture. The completed sample is available in the dotnet/samples repository on GitHub.
This tutorial demonstrates how to deploy an existing ASP.NET MVC app in a Windows Docker Container.
View and download samples
Many topics show source code and samples that are available for viewing or download from GitHub. To view a sample, just follow the sample link. To download the code, follow these instructions:
Download the repository that contains the sample code by performing one of the following procedures:
Download a ZIP of the repository to your local system. Un-ZIP the compressed archive.
Fork the repository and clone the fork to your local system. Forking and cloning permits you to make contributions to the documentation by committing changes to your fork and then creating a pull request for the official docs repository. For more information, see the .NET Documentation Contributing Guide and the ASP.NET Core Docs Contributing Guide.
Clone the repository locally. If you clone a docs repository directly to your local system, you won't be able to make commits directly against the official repository, so you won't be able to make documentation contributions later. Use the fork and clone procedure previously described if you want to preserve the opportunity to contribute to the documentation later.
Navigate within the repository's folders to the sample's location. The relative path to the sample's location appears in your browser's address bar when you follow the link to the sample.
To run a sample, you have several options:
Use the .NET CLI: In a console window, navigate to the sample's folder and use dotnet CLI commands.
Use Visual Studio: Open the sample by selecting File > Open > Project/Solution from the menu bar, navigate to the sample project folder, and select the project file (.csproj or .fsproj).
Use Visual Studio Code: Open the sample by selecting File > Open Folder from the menu bar and selecting the sample's project folder.
Use a different IDE that supports .NET projects.
Cộng tác với chúng tôi trên GitHub
Bạn có thể tìm thấy nguồn cho nội dung này trên GitHub, nơi bạn cũng có thể tạo và xem lại các vấn đề và yêu cầu kéo. Để biết thêm thông tin, hãy xem hướng dẫn dành cho người đóng góp của chúng tôi.
Ý kiến phản hồi về .NET
.NET là một dự án nguồn mở. Chọn liên kết để cung cấp ý kiến phản hồi:
Tham gia chuỗi buổi gặp gỡ để xây dựng các giải pháp AI có thể mở rộng dựa trên các trường hợp sử dụng trong thế giới thực với các nhà phát triển và chuyên gia đồng nghiệp.
.NET là một nền tảng miễn phí, đa nền tảng, mã nguồn mở dành cho việc xây dựng nhiều loại ứng dụng khác nhau. Với .NET, bạn có thể sử dụng nhiều ngôn ngữ, trình soạn thảo và thư viện để xây dựng cho web, thiết bị di động, máy tính để bàn, trò chơi và IoT.
Xây dựng các giải pháp toàn năng trong Microsoft Azure để tạo Azure Functions, triển khai và quản lý các ứng dụng web, phát triển các giải pháp sử dụng bộ nhớ Azure và hơn thế nữa.