我有一个针对net4.6.1的ASP.NET Core项目
每当我尝试使用dotnet run
从VS2017和命令行通过调试启动项目时,都会引发以下错误。
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>
我可以提到我有一个作为ASP.NET Core项目创建的启动项目,以及多个针对net461的.net核心类库项目。
知道问题出在哪里吗?
答案 0 :(得分:0)
您是否尝试过在VS2017选项的debugging> general部分中启用“使用托管的兼容模式”。