Skip to content
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

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

Closed
lt-gerjan opened this issue Jul 10, 2018 · 11 comments

Comments

@lt-gerjan
Copy link

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
@lt-gerjan
Copy link
Author

lt-gerjan commented 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?

@lt-gerjan
Copy link
Author

  • Adding <TargetLatestRuntimePatch>true</TargetLatestRuntimePatch> does not work
  • Adding <RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion> does not work
  • Adding <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.1.1" /> DOES work (so upgrade it)

@nguerrera
Copy link
Contributor

nguerrera commented Jul 14, 2018

cc @natemcmaster @dsplaisted

Yes, there are a lot of related issues. Lots of folks are working hard on improving the experiences around this.

Adding <PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="2.1.1" /> DOES work (so upgrade it)

I believe this would be the correct handling here.

@natemcmaster
Copy link
Contributor

@gkonterman sorry this has been frustrating. I have been working hard on making improvements as soon as we can get it into a new SDK. I would recommend removing the PackageReference to Microsoft.AspNetCore.SpaServices.Extensions line altogether from your project. This package is part of the Microsoft.AspNetCore.App metapackage, so you don't need a direct dependency on this package anymore. This should resolve all issues with conflicts between these two packages.

See also these issues for some ongoing discussion on what we hope to do to fix problems in this space:

dotnet/aspnetcore#3292
dotnet/aspnetcore#3307

@lt-gerjan
Copy link
Author

lt-gerjan commented Jul 15, 2018

@nguerrera @natemcmaster Thank you both 👍

@bblair2018
Copy link

I just created a ticket on this and sent this to MSFT. I was trying to create a self hosted build agent for ASP.NET Core, and got the same message. Not sure how to make this go away. The build machine, VS, does not have projects and is just required by the build agent to the build. Please help.....

@natemcmaster
Copy link
Contributor

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.

@sajeetharan
Copy link
Member

Thanks @natemcmaster :) worked well 👍

@CodeSwimBikeRunner
Copy link

What other References are part of the Microsoft.AspNetCore.App metapackage, because we are also experiencing this issue.

@felixhayashi
Copy link

@ChristopherLClark open "Dependencies" on the nuget package
https://www.nuget.org/packages/Microsoft.AspNetCore.App/2.1.4

@rickhopkins
Copy link

I keep running into a similar issue only in Visual Studio on my mac. I have no idea how to fix this. I can run it fine Visual Studio 2017 on windows, and I can run the code in VS Code with the c# extension. Running dotnet build will work fine on the projects, but trying to run it through Visual Studio 2017 on mac does not build.

screen shot 2018-12-10 at 7 31 37 am

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants