AspNetCore.Docs
AspNetCore.Docs copied to clipboard
using a locally published web app
[EDIT by guardrex to fix the code blocks]
Description
Your document is hard to follow.
The following code does not work:
public class ProductsController : Controller
{
public IActionResult Details(int id)
{
return ControllerContext.MyDisplayRouteInfo(id);
}
}
I get a CS1061 error.
I have added the package to the project's csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.8" />
<PackageReference Include="microsoft.entityframeworkcore.inmemory" Version="8.0.8" />
<PackageReference Include="NSwag.AspNetCore" Version="14.1.0" />
<PackageReference Include="Rick.Docs.Samples.RouteInfo" Version="1.0.0.8" />
</ItemGroup>
</Project>
Page URL
https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/routing?view=aspnetcore-8.0&preserve-view=true
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/mvc/controllers/routing.md
Document ID
7838ccec-c8e8-9baa-2b3e-220b2af5fc58
Article author
@tdykstra