gpt4 book ai didi

.net - 这些 ASP.NET Core 依赖项警告的来源是什么?

转载 作者:行者123 更新时间:2023-12-02 13:37:03 25 4
gpt4 key购买 nike

在更新包运行我的解决方案后,我的 ASP.Net Core 项目中充满了遵循下面概述的模式的警告。

我不知道这个问题的根本原因。

模式:

Dependency Conflict. [project name] [project version] expected [dependency name] >= [registered version] but received [lower version]

Dependency specified was [dependency name] >= [registered version] but ended up with [dependency name] [lower version]

示例:我对依赖项 Microsoft.Extensions.Logging v1.1.1 有此警告:

Dependency Conflict. Statistics 1.0.0 expected Microsoft.Extensions.Logging >= 1.1.1 but received 1.1.0

Dependency specified was Microsoft.Extensions.Logging >= 1.1.1 but ended up with Microsoft.Extensions.Logging 1.1.0

公平地说,在运行 Update-Packages cmdlet 之前,project.json 文件确实引用了 Microsoft.Extensions.Logging v1.1.0。

更新后的project.json文件:

{
"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true,
"xmlDoc": true,
"nowarn": [ "CS1591" ]
},
"dependencies": {
"BusinessEntities": "1.0.0-*",
"IdentityServer4.AccessTokenValidation": "1.1.0",
"Ioc": "1.0.0-*",
"Microsoft.AspNet.WebApi.Client": "5.2.3",
"Microsoft.AspNetCore.Diagnostics": "1.1.1",
"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.1",
"Microsoft.AspNetCore.Mvc": "1.1.2",
"Microsoft.AspNetCore.Routing": "1.1.1",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.1",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.1",
"Microsoft.AspNetCore.Server.Kestrel.Https": "1.1.1",
"Microsoft.Extensions.Configuration.CommandLine": "1.1.1",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.1",
"Microsoft.Extensions.Configuration.FileExtensions": "1.1.1",
"Microsoft.Extensions.Configuration.Json": "1.1.1",
"Microsoft.Extensions.Logging": "1.1.1",
"Microsoft.Extensions.Logging.Console": "1.1.1",
"Microsoft.Extensions.Logging.Debug": "1.1.1",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.1",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0",
"Swashbuckle.AspNetCore": "1.0.0-rc1",
"Swashbuckle.AspNetCore.Swagger": "1.0.0-rc1",
"Swashbuckle.AspNetCore.SwaggerGen": "1.0.0-rc1",
"Swashbuckle.AspNetCore.SwaggerUi": "1.0.0-rc1",
"System.Xml.XmlDocument": "4.3.0",
"Unity": "4.0.1",
"WebApiCommon": "1.0.0-*"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.1"
}

},
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},
"publishOptions": {
"include": [
"wwwroot",
"**/*.cshtml",
"appsettings.json",
"web.config"
]
},
"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
},
"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.1.0-preview4-final",
"Microsoft.DotNet.Watcher.Tools": "1.1.0-preview4-final"
}
}

最佳答案

你的project.json对我来说看起来不错,除非你的BusinessEntitiesIocWebApiCommon包有对您收到警告的旧版本软件包的引用。由于我看不到这些包的依赖项列表,因此我无法确定。

如果这些包不是警告的来源,那么我的猜测是您关于重新启动 Visual Studio 的答案起到了作用。对于我来说,Visual Studio 与当前的一组包错误或警告失去同步在 Beta 工具上很常见。

要完全排除 Visual Studio,请在项目文件夹内的命令行上执行 dotnet Restoredotnet build。您可以将在那里看到的消息和错误视为权威来源。

关于.net - 这些 ASP.NET Core 依赖项警告的来源是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42767539/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com