1

I have a project with Asp.Net Core 2.1.1, so I have to force the runtime to 2.1.1, when I added the EF Core 2.1.1 packages (SqlServer, Design and Tools). Locally the project performs well, however in the process of Build in VSTS using the Hosted VS2017 the build process fails, it does not restore the packages by dependency conflict. I installed the packages he asks for:

Microsoft.EntityFrameworkCore After New Failure Microsoft.EntityFrameworkCore.Abstractions and then Microsoft.EntityFrameworkCore.Analyzers ...

This is the way? Go running and failing build a build until you discover all the packages that need to be placed as dependencies? Anyone have any tips to solve this another way?

My build process is like the .net core of VSTS.

This is my .csproj file

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
    <RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="2.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="2.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.1" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.3" />
  </ItemGroup>
</Project>
0

I also could not restore packages after upgrading to 2.1.1. I got multiple errors similar to this:

Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.0 requires Microsoft.EntityFrameworkCore (= 2.1.0) but version Microsoft.EntityFrameworkCore 2.1.1 was resolved.

I solved my problem by explicitly specifying version 2.1.301 in the build definition.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.