.Net 6 support for CLI Build #804
-
Greetings, I am using .net 6 and build using the CLI but when I added the aspnet-api-versioning the build command give be an error "Unable to resolve 'Microsoft.AspNetCore.Mvc.Versioning (>= 5.0.0)' for 'net6.0'" |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Officially, there is not formal support nor a TFM target for dotnet new console --name ApiVersioningConsole
cd ApiVersioningConsole
dotnet add package Microsoft.AspNetCore.Mvc.Versioning
dotnet build The commands all succeed. Here's what the final project looks like: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
</ItemGroup>
</Project> I'm not sure which CLI or version of it that you are using, but perhaps it is out-of-date. There's a lot more to the back story, but I've been actively and feverously working on support for .NET 6.0. Big changes are coming and we're almost there. My goal is to have the announcement and roadmap out by the end of the week. |
Beta Was this translation helpful? Give feedback.
Officially, there is not formal support nor a TFM target for
net6.0
; however, many people have gotten it to work without issue (at least not reported). I attempted to repo your scenario and it worked without issue for me. Here's what I used:dotnet new console --name ApiVersioningConsole cd ApiVersioningConsole dotnet add package Microsoft.AspNetCore.Mvc.Versioning dotnet build
The commands all succeed. Here's what the final project looks like: