Home >Backend Development >C++ >How to Reference ASP.NET Core 6 SDK in App Parts Projects?

How to Reference ASP.NET Core 6 SDK in App Parts Projects?

Barbara Streisand
Barbara StreisandOriginal
2024-12-27 18:41:101039browse

How to Reference ASP.NET Core 6 SDK in App Parts Projects?

NuGet Package References for ASP.NET Core 6 Application Parts Projects

In ASP.NET Core 6, the Microsoft.AspNetCore.App package is no longer used for referencing the ASP.NET Core SDK in app parts projects. Instead, a combination of the Microsoft.NET.Sdk SDK and a FrameworkReference item is required.

Adding Required References

To add the necessary package references to an ASP.NET Core 6 application parts project, follow these steps:

  1. Set the Sdk property in the project file to Microsoft.NET.Sdk.
  2. Add the following FrameworkReference item to the project file:

This will add the necessary references to the ASP.NET Core SDK and allow you to register app parts assemblies using extension methods as shown below:

Defining Entry Point

To satisfy the build requirement of defining an entry point, you can add an internal Program class to your project file:

With these changes, your app parts project will be able to successfully integrate additional areas into your ASP.NET Core 6 application.

The above is the detailed content of How to Reference ASP.NET Core 6 SDK in App Parts Projects?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn