我遇到了以下问题。
Detected package downgrade: Microsoft.NETCore.App from 2.0.0-preview3-25514-02 to 2.0.0-preview2-006497
在具有以下csproj的项目上执行dotnet restore
:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<DebugType>portable</DebugType>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>FoodgetWebapp</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>FoodgetWebapp</PackageId>
<UserSecretsId>FoodgetWebapp-c23d27a4-eb88-4b18-9b77-2a93f3b15119</UserSecretsId>
<RuntimeFrameworkVersion>2.0.0-preview2-006497</RuntimeFrameworkVersion>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
<ItemGroup>
<Compile Remove="node_modules\**\*;Client\**\*" />
<Content Remove="wwwroot\dist\**\*" />
</ItemGroup>
<Target Name="RunWebpack" BeforeTargets="BeforePublish">
<Exec Command="npm run clean:dist" />
<Exec Command="npm run build:prod" />
<ItemGroup>
<DistFiles Include="wwwroot\dist\**\*" />
<Content Include="@(DistFiles)" CopytoPublishDirectory="Always" />
<Content Include="app.yaml" CopyToOutputDirectory="Always" />
<ContentWithTargetPath Include="@(DistFiles)" TargetPath="%(Identity)" CopyToPublishDirectory="Always" />
</ItemGroup>
</Target>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-preview2-006497" />
<PackageReference Include="AspNet.Security.OAuth.Introspection" Version="2.0.0-*" />
<PackageReference Include="AspNet.Security.OAuth.Validation" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.AzureAppServicesIntegration" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.MicrosoftAccount" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel.Https" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0-*" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.ResponseCompression" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.WebSockets" Version="2.0.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.0.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="2.0.0-*" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0-*" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0-*" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0-*" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0-*" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.AngularServices" Version="1.1.0-beta-000002" />
<PackageReference Include="AspNet.Security.OAuth.GitHub" Version="1.0.0-rc2-final" />
<PackageReference Include="AspNet.Security.OAuth.LinkedIn" Version="1.0.0-rc2-final" />
<PackageReference Include="OpenIddict" Version="2.0.0-*" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" Version="2.0.0-*" />
<PackageReference Include="OpenIddict.Mvc" Version="2.0.0-*" />
<PackageReference Include="SendGrid.NetCore" Version="1.0.0-rtm-00002" />
<PackageReference Include="MailKit" Version="1.16.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="1.0.0" />
<PackageReference Include="Twilio" Version="5.3.0" />
<PackageReference Include="Stripe.net" Version="8.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
<PackageReference Include="Webpack" Version="4.0.0" />
<PackageReference Include="Serilog" Version="2.4.1-dev-00801" />
<PackageReference Include="Serilog.Extensions.Logging" Version="1.4.1-dev-10155" />
<PackageReference Include="Serilog.Sinks.Seq" Version="3.2.0" />
<PackageReference Include="Bogus" Version="15.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0-*">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0-*">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0-preview2-*" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0-*" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0-*" />
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0-*" />
<!-- <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0-*" /> -->
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0-*" />
</ItemGroup>
</Project>
我做错了吗?
具体的错误信息如下:
error NU1605: Detected package downgrade: Microsoft.NETCore.App from 2.0.0-preview3-25514-02 to 2.0.0-preview2-006497. Reference the package directly from the project to select a different version.
答案 0 :(得分:0)
你有
<PackageReference Include="Microsoft.NETCore.App" Version="2.0.0-preview2-006497" />
在你的csproj中。但是因为你在所有其他版本上使用通配符
<PackageReference Include="Microsoft.AspNetCore.AzureAppServicesIntegration" Version="2.0.0-*" />
它试图获得每晚预览3。通常你不应该使用夜间构建,除非你知道你正在做什么,只是使用主要nuget源上发布的预览之一