-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Class project why need add Microsoft.AspNetCore.MVC ProjectReference in aspnetcore2.2 if already included Microsoft.AspNetCore.App 2.2.0 #8546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for contacting us, @shps951023. |
Newest tests have found problems with not only for netcoreapp2.2 , but also netcoreapp2.1 .
@pranavkm , @mkArtakMSFT thanks. here is test project link : |
The shared framework ( |
Does it mean that if i make a Controller Lib Project then Microsoft recommend that you specify a version of each framework? e.g <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2'">
<PackageReference Include="Microsoft.AspNetCore.App" version="2.2.0"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.App" version="2.1.1"/>
</ItemGroup>
</Project> or just PackageReference <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1;netcoreapp2.2;</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.2'">
<PackageReference Include="Microsoft.AspNetCore.MVC" version="2.2.0"/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1'">
<PackageReference Include="Microsoft.AspNetCore.MVC" version="2.1.1"/>
</ItemGroup>
</Project> |
@shps951023 this is specifically to work with MVC's auto-discovery of controllers. We'd addressing some of this in 2.x. Also the recommendation is to not specify a version for |
thanks |
Uh oh!
There was an error while loading. Please reload this page.
c# - aspnetcore web project import another project's controller - Stack Overflow
two project's csproj and version :
AspNetCore Web Project
Controller Project
Controller Project Code
https://i.stack.imgur.com/zmYxW.png
Question
if run AspNetCore Web Project it'll get
HTTP ERROR 404
.I need to add
<PackageReference Include="Microsoft.AspNetCore.MVC"/>
in cspojto run successfully.
But Isn't NuGet | Microsoft.AspNetCore.App 2.2.0 already included
Microsoft.AspNetCore.MVC
,Why i need to add again?The text was updated successfully, but these errors were encountered: