Asp.net 进程创建失败,错误为:在调试模式下启动项目时拒绝访问

Asp.net 进程创建失败,错误为:在调试模式下启动项目时拒绝访问,asp.net,.net,visual-studio,asp.net-core,.net-core,Asp.net,.net,Visual Studio,Asp.net Core,.net Core,我有一个ASP.NET核心项目,目标是net4.6.1 每次我尝试通过调试从VS2017和命令行使用dotnet run启动项目时,都会引发以下错误 csproj如下所示: <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net461</TargetFramework> <Platforms>x64</Platfo

我有一个ASP.NET核心项目,目标是net4.6.1 每次我尝试通过调试从VS2017和命令行使用
dotnet run
启动项目时,都会引发以下错误

csproj如下所示:

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

  <PropertyGroup>
    <TargetFramework>net461</TargetFramework>
    <Platforms>x64</Platforms>
    <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
    <AspNetCoreModuleName>AspNetCoreModule</AspNetCoreModuleName>
    <StartupObject></StartupObject>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.HttpsPolicy" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
  </ItemGroup>

  <ItemGroup>
    <ProjectReference Include="..\pathToAnotherProject\myproject.csproj" />
  </ItemGroup>

</Project>

net461
x64
进程外
AspNetCore模块
我可以提到,我有一个作为ASP.NET核心项目创建的启动项目和多个以net461为目标的.NET核心类库项目


知道问题出在哪里吗?

您是否尝试在VS2017选项的调试>常规部分启用“使用托管兼容性模式”。

是,没有成功