Skip to content
2 changes: 1 addition & 1 deletion docs/ai/quickstarts/includes/ai-templates-azure-openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ms.author: alexwolf

* [.NET 9.0 SDK](https://dotnet.microsoft.com/download)
* One of the following IDEs (optional):
* [Visual Studio 2022](https://visualstudio.microsoft.com/)
* [Visual Studio](https://visualstudio.microsoft.com/)
* [Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)

## Install the .NET AI app template
Expand Down
2 changes: 1 addition & 1 deletion docs/ai/quickstarts/includes/ai-templates-github-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ms.author: alexwolf

* [.NET 9.0 SDK](https://dotnet.microsoft.com/download)
* One of the following IDEs (optional):
* [Visual Studio 2022](https://visualstudio.microsoft.com/)
* [Visual Studio](https://visualstudio.microsoft.com/)
* [Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)

## Install the .NET AI app template
Expand Down
2 changes: 1 addition & 1 deletion docs/ai/quickstarts/includes/ai-templates-ollama.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ms.author: alexwolf
* [.NET 9.0 SDK](https://dotnet.microsoft.com/download)
* Ollama installed locally - [Install Ollama](https://ollama.com/) locally on your device
* One of the following IDEs (optional):
* [Visual Studio 2022](https://visualstudio.microsoft.com/)
* [Visual Studio](https://visualstudio.microsoft.com/)
* [Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)

## Install the .NET AI app template
Expand Down
2 changes: 1 addition & 1 deletion docs/ai/quickstarts/includes/ai-templates-openai.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ms.author: alexwolf
* [.NET 9.0 SDK](https://dotnet.microsoft.com/download)
* Access to an [OpenAI service](https://openai.com/api/) and the corresponding API key
* One of the following IDEs (optional):
* [Visual Studio 2022](https://visualstudio.microsoft.com/)
* [Visual Studio](https://visualstudio.microsoft.com/)
* [Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)

## Install the .NET AI app template
Expand Down
20 changes: 10 additions & 10 deletions docs/architecture/blazor-for-web-forms-developers/app-startup.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ Applications that are written for ASP.NET typically have a `global.asax.cs` file

## Application_Start and Web Forms

The default web forms `Application_Start` method has grown in purpose over years to handle many configuration tasks. A fresh web forms project with the default template in Visual Studio 2022 now contains the following configuration logic:
The default web forms `Application_Start` method has grown in purpose over years to handle many configuration tasks. A fresh web forms project with the default template in Visual Studio contains the following configuration logic:

- `RouteConfig` - Application URL routing
- `BundleConfig` - CSS and JavaScript bundling and minification

Each of these individual files resides in the `App_Start` folder and run only once at the start of our application. `RouteConfig` in the default project template adds the `FriendlyUrlSettings` for web forms to allow application URLs to omit the `.ASPX` file extension. The default template also contains a directive that provides permanent HTTP redirect status codes (HTTP 301) for the `.ASPX` pages to the friendly URL with the file name that omits the extension.
Each of these individual files resides in the `App_Start` folder and run only once at the start of our application. `RouteConfig` in the default project template adds the `FriendlyUrlSettings` for web forms to allow application URLs to omit the `.ASPX` file extension. The default template also contains a directive that provides permanent HTTP redirect status codes (HTTP 301) for the `.ASPX` pages to the friendly URL with the file name that omits the extension.

With ASP.NET Core and Blazor, these methods are either simplified and consolidated into the `Startup` class or they are eliminated in favor of common web technologies.

## Blazor Server Startup Structure

Blazor Server applications reside on top of an ASP.NET Core 3.0 or later version. ASP.NET Core web applications are configured in *Program.cs*, or through a pair of methods in the `Startup.cs` class. A sample *Program.cs* file is shown below:
Blazor Server applications reside on top of an ASP.NET Core 3.0 or later version. ASP.NET Core web applications are configured in *Program.cs*, or through a pair of methods in the `Startup.cs` class. A sample *Program.cs* file is shown below:

```csharp
using BlazorApp1.Data;
Expand Down Expand Up @@ -57,25 +57,25 @@ app.MapFallbackToPage("/_Host");
app.Run();
```

The app's required services are added to the `WebApplicationBuilder` instance's `Services` collection. This is how the various ASP.NET Core framework services are configured with the framework's built-in dependency injection container. The various `builder.Services.Add*` methods add services that enable features such as authentication, razor pages, MVC controller routing, SignalR, and Blazor Server interactions among many others. This method was not needed in web forms, as the parsing and handling of the ASPX, ASCX, ASHX, and ASMX files were defined by referencing ASP.NET in the web.config configuration file. More information about dependency injection in ASP.NET Core is available in the [online documentation](/aspnet/core/fundamentals/dependency-injection).
The app's required services are added to the `WebApplicationBuilder` instance's `Services` collection. This is how the various ASP.NET Core framework services are configured with the framework's built-in dependency injection container. The various `builder.Services.Add*` methods add services that enable features such as authentication, razor pages, MVC controller routing, SignalR, and Blazor Server interactions among many others. This method was not needed in web forms, as the parsing and handling of the ASPX, ASCX, ASHX, and ASMX files were defined by referencing ASP.NET in the web.config configuration file. More information about dependency injection in ASP.NET Core is available in the [online documentation](/aspnet/core/fundamentals/dependency-injection).

After the `app` has been built by the `builder`, the rest of the calls on `app` configure its HTTP pipeline. With these calls, we declare from top to bottom the [Middleware](middleware.md) that will handle every request sent to our application. Most of these features in the default configuration were scattered across the web forms configuration files and are now in one place for ease of reference.

No longer is the configuration of the custom error page placed in a `web.config` file, but now is configured to always be shown if the application environment is not labeled `Development`. Additionally, ASP.NET Core applications are now configured to serve secure pages with TLS by default with the `UseHttpsRedirection` method call.
No longer is the configuration of the custom error page placed in a `web.config` file, but now is configured to always be shown if the application environment is not labeled `Development`. Additionally, ASP.NET Core applications are now configured to serve secure pages with TLS by default with the `UseHttpsRedirection` method call.

Next, an unexpected configuration method call is made to `UseStaticFiles`. In ASP.NET Core, support for requests for static files (like JavaScript, CSS, and image files) must be explicitly enabled, and only files in the app's *wwwroot* folder are publicly addressable by default.
Next, an unexpected configuration method call is made to `UseStaticFiles`. In ASP.NET Core, support for requests for static files (like JavaScript, CSS, and image files) must be explicitly enabled, and only files in the app's *wwwroot* folder are publicly addressable by default.

The next line is the first that replicates one of the configuration options from web forms: `UseRouting`. This method adds the ASP.NET Core router to the pipeline and it can be either configured here or in the individual files that it can consider routing to. More information about routing configuration can be found in the [Routing section](pages-routing-layouts.md).
The next line is the first that replicates one of the configuration options from web forms: `UseRouting`. This method adds the ASP.NET Core router to the pipeline and it can be either configured here or in the individual files that it can consider routing to. More information about routing configuration can be found in the [Routing section](pages-routing-layouts.md).

The final `app.Map*` calls in this section define the endpoints that ASP.NET Core is listening on. These routes are the web accessible locations that you can access on the web server and receive some content handled by .NET and returned to you. The first entry, `MapBlazorHub` configures a SignalR hub for use in providing the real-time and persistent connection to the server where the state and rendering of Blazor components is handled. The `MapFallbackToPage` method call indicates the web-accessible location of the page that starts the Blazor application and also configures the application to handle deep-linking requests from the client-side. You will see this feature at work if you open a browser and navigate directly to Blazor handled route in your application, such as `/counter` in the default project template. The request gets handled by the *_Host.cshtml* fallback page, which then runs the Blazor router and renders the counter page.
The final `app.Map*` calls in this section define the endpoints that ASP.NET Core is listening on. These routes are the web accessible locations that you can access on the web server and receive some content handled by .NET and returned to you. The first entry, `MapBlazorHub` configures a SignalR hub for use in providing the real-time and persistent connection to the server where the state and rendering of Blazor components is handled. The `MapFallbackToPage` method call indicates the web-accessible location of the page that starts the Blazor application and also configures the application to handle deep-linking requests from the client-side. You will see this feature at work if you open a browser and navigate directly to Blazor handled route in your application, such as `/counter` in the default project template. The request gets handled by the *_Host.cshtml* fallback page, which then runs the Blazor router and renders the counter page.

The very last line starts the application, something that wasn't required in web forms (since it relied on IIS to be running).

## Upgrading the BundleConfig Process

Technologies for bundling assets like CSS stylesheets and JavaScript files have changed significantly, with other technologies providing quickly evolving tools and techniques for managing these resources. To this end, we recommend using a Node command-line tool such as Grunt / Gulp / WebPack to package your static assets.
Technologies for bundling assets like CSS stylesheets and JavaScript files have changed significantly, with other technologies providing quickly evolving tools and techniques for managing these resources. To this end, we recommend using a Node command-line tool such as Grunt / Gulp / WebPack to package your static assets.

The Grunt, Gulp, and WebPack command-line tools and their associated configurations can be added to your application and ASP.NET Core will quietly ignore those files during the application build process. You can add a call to run their tasks by adding a `Target` inside your project file with syntax similar to the following that would trigger a gulp script and the `min` target inside that script:
The Grunt, Gulp, and WebPack command-line tools and their associated configurations can be added to your application and ASP.NET Core will quietly ignore those files during the application build process. You can add a call to run their tasks by adding a `Target` inside your project file with syntax similar to the following that would trigger a gulp script and the `min` target inside that script:

```xml
<Target Name="MyPreCompileTarget" BeforeTargets="Build">
Expand Down
6 changes: 3 additions & 3 deletions docs/architecture/cloud-native/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ At run time, each message is serialized as a standard Protobuf representation an

gRPC is integrated into .NET Core 3.0 SDK and later. The following tools support it:

- Visual Studio 2022 with the ASP.NET and web development workload installed
- Visual Studio 2022 or later with the ASP.NET and web development workload installed
- Visual Studio Code
- The `dotnet` CLI

Expand All @@ -59,8 +59,8 @@ The SDK includes tooling for endpoint routing, built-in IoC, and logging. The op
![gRPC Support in Visual Studio 2022](./media/visual-studio-2022-grpc-template.png)

**Figure 4-20**. gRPC support in Visual Studio 2022
Figure 4-21 shows the skeleton gRPC service generated from the built-in scaffolding included in Visual Studio 2022.

Figure 4-21 shows the skeleton gRPC service generated from the built-in scaffolding included in Visual Studio 2022.

![gRPC project in Visual Studio 2022](./media/grpc-project.png )

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In this section, this whole process is detailed and every major step is explaine

When you're using an editor/CLI development approach (for example, Visual Studio Code plus Docker CLI on macOS or Windows), you need to know every step, generally in more detail than if you're using Visual Studio. For more information about working in a CLI environment, see the e-book [Containerized Docker Application lifecycle with Microsoft Platforms and Tools](https://aka.ms/dockerlifecycleebook/).

When you're using Visual Studio 2022, many of those steps are handled for you, which dramatically improves your productivity. This is especially true when you're using Visual Studio 2022 and targeting multi-container applications. For instance, with just one mouse click, Visual Studio adds the `Dockerfile` and `docker-compose.yml` file to your projects with the configuration for your application. When you run the application in Visual Studio, it builds the Docker image and runs the multi-container application directly in Docker; it even allows you to debug several containers at once. These features will boost your development speed.
When you're using Visual Studio 2022 or later, many of those steps are handled for you, which dramatically improves your productivity. This is especially true when you're targeting multi-container applications. For instance, with just one mouse click, Visual Studio adds the `Dockerfile` and `docker-compose.yml` file to your projects with the configuration for your application. When you run the application in Visual Studio, it builds the Docker image and runs the multi-container application directly in Docker; it even allows you to debug several containers at once. These features will boost your development speed.

However, just because Visual Studio makes those steps automatic doesn't mean that you don't need to know what's going on underneath with Docker. Therefore, the following guidance details every step.

Expand All @@ -48,7 +48,7 @@ To begin, make sure you have [Docker Desktop for Windows](https://docs.docker.co

[Get started with Docker Desktop for Windows](https://docs.docker.com/docker-for-windows/)

In addition, you need Visual Studio 2022 version 17.0, with the **.ASP.NET and web development** workload installed, as shown in Figure 5-2.
In addition, you need Visual Studio 2022 or later with the **.ASP.NET and web development** workload installed, as shown in Figure 5-2.

![Screenshot of the .NET Core cross-platform development selection.](./media/docker-app-development-workflow/dotnet-core-cross-platform-development.png)

Expand All @@ -61,7 +61,7 @@ You can start coding your application in plain .NET (usually in .NET Core or lat
- **Get started with Docker Desktop for Windows** \
<https://docs.docker.com/docker-for-windows/>

- **Visual Studio 2022** \
- **Visual Studio** \
[https://visualstudio.microsoft.com/downloads/](https://visualstudio.microsoft.com/downloads/)

![Image for Step 2.](./media/docker-app-development-workflow/step-2-write-dockerfile.png)
Expand All @@ -72,7 +72,7 @@ You need a Dockerfile for each custom image you want to build; you also need a D

The Dockerfile is placed in the root folder of your application or service. It contains the commands that tell Docker how to set up and run your application or service in a container. You can manually create a Dockerfile in code and add it to your project along with your .NET dependencies.

With Visual Studio and its tools for Docker, this task requires only a few mouse clicks. When you create a new project in Visual Studio 2022, there's an option named **Enable Docker Support**, as shown in Figure 5-3.
With Visual Studio and its tools for Docker, this task requires only a few mouse clicks. When you create a new project in Visual Studio, there's an option named **Enable Docker Support**, as shown in Figure 5-3.

![Screenshot showing Enable Docker Support check box.](./media/docker-app-development-workflow/enable-docker-support-check-box.png)

Expand Down Expand Up @@ -404,7 +404,7 @@ The docker-compose.yml file specifies not only what containers are being used, b

We will revisit the docker-compose.yml file in a later section when we cover how to implement microservices and multi-container apps.

### Working with docker-compose.yml in Visual Studio 2022
### Working with docker-compose.yml in Visual Studio

Besides adding a Dockerfile to a project, as we mentioned before, Visual Studio 2017 (from version 15.8 on) can add orchestrator support for Docker Compose to a solution.

Expand Down Expand Up @@ -519,9 +519,9 @@ You can also test the application using curl from the terminal, as shown in Figu

**Figure 5-14**. Example of testing your Docker application locally using curl

### Testing and debugging containers with Visual Studio 2022
### Testing and debugging containers with Visual Studio

When running and debugging the containers with Visual Studio 2022, you can debug the .NET application in much the same way as you would when running without containers.
When running and debugging the containers with Visual Studio, you can debug the .NET application in much the same way as you would when running without containers.

### Testing and debugging without Visual Studio

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ms.date: 11/19/2021

Whether you prefer a full and powerful IDE or a lightweight and agile editor, Microsoft has tools that you can use for developing Docker applications.

**Visual Studio (for Windows).** Docker-based .NET 8 application development with Visual Studio requires Visual Studio 2022 version 17.0 or later. Visual Studio 2022 comes with tools for Docker already built in. The tools for Docker let you develop, run, and validate your applications directly in the target Docker environment. You can press <kbd>F5</kbd> to run and debug your application (single container or multiple containers) directly into a Docker host, or press <kbd>CTRL</kbd> + <kbd>F5</kbd> to edit and refresh your application without having to rebuild the container. This IDE is the most powerful development choice for Docker-based apps.
**Visual Studio (for Windows).** Docker-based .NET 8 application development with Visual Studio requires Visual Studio 2022 or later. Visual Studio comes with tools for Docker already built in. The tools for Docker let you develop, run, and validate your applications directly in the target Docker environment. You can press <kbd>F5</kbd> to run and debug your application (single container or multiple containers) directly into a Docker host, or press <kbd>CTRL</kbd> + <kbd>F5</kbd> to edit and refresh your application without having to rebuild the container. This IDE is the most powerful development choice for Docker-based apps.

**Visual Studio Code and Docker CLI**. If you prefer a lightweight and cross-platform editor that supports any development language, you can use Visual Studio Code and the Docker CLI. This IDE is a cross-platform development approach for macOS, Linux, and Windows. Additionally, Visual Studio Code supports extensions for Docker such as IntelliSense for Dockerfiles and shortcut tasks to run Docker commands from the editor.

Expand Down
Loading
Loading