question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERROR: Detected package downgrade: Microsoft.AspNetCore.SpaServices.Extensions from 2.1.1 to 2.1.0.

See original GitHub issue

Steps to reproduce

  • Install latest .net core SDK
  • Have a previous .net core app

csproj

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

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
    <TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
    <IsPackable>false</IsPackable>
    <SpaRoot>ClientApp\</SpaRoot>
    <DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.1.0" />
  </ItemGroup>

  <ItemGroup>
    <!-- Don't publish the SPA source files, but do show them in the project files list -->
    <Content Remove="$(SpaRoot)**" />
    <None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**" />
  </ItemGroup>

  <Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
    <!-- Ensure Node.js is installed -->
    <Exec Command="node --version" ContinueOnError="true">
      <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
    </Exec>
    <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
    <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
  </Target>

  <Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
    <!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" />

    <!-- Include the newly-built files in the publish output -->
    <ItemGroup>
      <DistFiles Include="$(SpaRoot)build\**; $(SpaRoot)build-ssr\**" />
      <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
        <RelativePath>%(DistFiles.Identity)</RelativePath>
        <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
      </ResolvedFileToPublish>
    </ItemGroup>
  </Target>

</Project>

Expected behavior

It should build and work

Actual behavior

Errors:

error NU1605: Detected package downgrade: Microsoft.AspNetCore.SpaServices.Extensions from 2.1.1 to 2.1.0. Reference the package directly from the project to select a different version. error NU1605: LogicTrade.Connect.UI.React -> Microsoft.AspNetCore.App 2.1.1 -> Microsoft.AspNetCore.SpaServices.Extensions (>= 2.1.1 && < 2.2.0) error NU1605: LogicTrade.Connect.UI.React -> Microsoft.AspNetCore.SpaServices.Extensions (>= 2.1.0)

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
Version:   2.1.301
Commit:    59524873d6

Runtime Environment:
OS Name:     Windows
OS Version:  6.1.7601
OS Platform: Windows
RID:         win7-x64
Base Path:   C:\Program Files\dotnet\sdk\2.1.301\

Host (useful for support):
 Version: 2.1.1
 Commit:  6985b9f684

.NET Core SDKs installed:
 2.0.2 [C:\Program Files\dotnet\sdk]
 2.1.2 [C:\Program Files\dotnet\sdk]
 2.1.4 [C:\Program Files\dotnet\sdk]
 2.1.100 [C:\Program Files\dotnet\sdk]
 2.1.101 [C:\Program Files\dotnet\sdk]
 2.1.102 [C:\Program Files\dotnet\sdk]
 2.1.103 [C:\Program Files\dotnet\sdk]
 2.1.104 [C:\Program Files\dotnet\sdk]
 2.1.200 [C:\Program Files\dotnet\sdk]
 2.1.201 [C:\Program Files\dotnet\sdk]
 2.1.300-preview1-008174 [C:\Program Files\dotnet\sdk]
 2.1.300-rc1-008673 [C:\Program Files\dotnet\sdk]
 2.1.300 [C:\Program Files\dotnet\sdk]
 2.1.301 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
 Microsoft.AspNetCore.All 2.1.0-preview1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
 Microsoft.AspNetCore.All 2.1.0-rc1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
 Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
 Microsoft.AspNetCore.All 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
 Microsoft.AspNetCore.App 2.1.0-preview1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 2.1.0-rc1-final [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.AspNetCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
 Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 2.1.0-preview1-26216-03 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 2.1.0-rc1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
 Microsoft.NETCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
 https://aka.ms/dotnet-download

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

12reactions
gerjandevcommented, Jul 10, 2018

Im not trying to be impolite, but last days/weeks I have a lot of such issues on .NET Core. What is going on?

More important: how can I fix this?

8reactions
natemcmastercommented, Jul 25, 2018

If you are on .NET Core 2.1, remove the PackageReference to Microsoft.AspNetCore.SpaServices.Extensions. This is part of the Microsoft.AspNetCore.App metapackage.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detected package downgrade: Microsoft.NETCore.App ...
I was unable to build the project and getting build error with Detected package downgrade: Microsoft.AspNetCore.Razor.Design from 2.2.0 to 2.1.0 ...
Read more >
Detected package downgrade: Microsoft.AspNetCore. ...
ERROR: Detected package downgrade: Microsoft.AspNetCore.SpaServices.Extensions from 2.1.1 to 2.1.0. #9576.
Read more >
NuGet Warning NU1605
Detected package downgrade : 'PackageC' from 2.0.0 to 1.1.0. Reference the package directly from the project to select a different version. ' ...
Read more >
The mystery of package downgrade issue
NET Core SDK 2.1 installed. Naturally, very first build failed. The issue. Compilation error said that Detected package downgrade: Microsoft.
Read more >
"Detected package downgrade" Wat? : r/dotnet
Hi, I have a worker service project, which builds fine locally, but as soon as I try to build it in my azure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found