Try to search your question here, if you can't find : Ask Any Question Now ?

aspnetcore web project import another project's controller

HomeCategory: stackoverflowaspnetcore web project import another project's controller
pragati asked 2 weeks ago

two project’s csproj and version :

AspNetCore Web Project

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
    <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
  </PropertyGroup>


  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
  </ItemGroup>


  <ItemGroup>
    <ProjectReference Include="..ControllerController.csproj" />
  </ItemGroup>
</Project>

Controller Project

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App"/>
  </ItemGroup>
</Project>

enter image description here

Controller Project Code

using Microsoft.AspNetCore.Mvc;

public class HomeController : Controller
{
    public IActionResult Index()
    {
        return Content("Hello S.O");
    }
}

Question

if run AspNetCore Web Project it’ll get HTTP ERROR 404,how do i reference it successfully?

1 Answers
Best Answer
Mannu answered 2 weeks ago
Your Answer

17 + 6 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com