dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.62k stars 25.31k forks source link

using a locally published web app #33440

Open patrickocal opened 2 months ago

patrickocal commented 2 months ago

[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

guardrex commented 2 months ago

Hello @patrickocal ... Tom will be along in a bit to assist you. I'm in a much earlier time zone πŸ˜„ and just passing through πŸšΆβ€β™‚οΈ.

Note that we can't accept/open ZIP files due to security risks that they pose. If you want to show code to either the doc authors or the product unit on their repo, please place a minimal project in GitHub and provide the link to it.

tdykstra commented 2 months ago

@patrickocal Just repeating what @guardrex wrote-- Can you provide a link to a public gitHub repo with the simplest possible complete project that shows the problem?