mysql依赖.net_c# - MySQL-> .NET Core依赖关系错误(MySql.Data) - 堆栈内存溢出

邢俊悟
2023-12-01

我们正在尝试通过.NET Core连接到MySQL数据库。 一切都在本地运行,但在运行gitlab-ci的服务器上,构建失败。 因此,构建失败。

引发的错误: error NU1001: The dependency MySql.Data >= 7.0.6-IR31 could not be resolved. 这很奇怪,因为它适用于我们的本地计算机,而不适用于在docker中运行的CI。

运行dotnet restore和dotnet run本地运行。 dotnet restore在服务器上也可以使用,您可以看到已安装MySql.Data软件包。 但是,在运行单元测试时,它会中断,因为无法解决依赖性。 也许与Linux不兼容?

我们做错了什么?

project.json文件:

{

"dependencies": {

"Microsoft.NETCore.App": {

"version": "1.0.0",

"type": "platform"

},

"Microsoft.AspNetCore.Mvc": "1.0.0",

"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",

"Microsoft.AspNetCore.Diagnostics": "1.0.0",

"Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",

"Microsoft.Extensions.Configuration": "1.0.0",

"Microsoft.Extensions.Configuration.CommandLine": "1.0.0",

"Microsoft.Extensions.Configuration.Binder": "1.0.0",

"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",

"Microsoft.Extensions.Configuration.Json": "1.0.0",

"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",

"Microsoft.Extensions.Logging": "1.0.0",

"Microsoft.Extensions.Logging.Console": "1.0.0",

"Microsoft.Extensions.Logging.Debug": "1.0.0",

"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",

"Microsoft.EntityFrameworkCore": "1.0.0",

"DotNetAirbrake": "1.0.33",

"Geitenbelang.AnimalManager.Api.Models": "1.0.0-*",

"Geitenbelang.AnimalManager.Api.Database": "1.0.0-*",

"AutoMapper": "5.1.1",

"MySql.Data.EntityFrameworkCore": "7.0.6-IR31"

},

"frameworks": {

"netcoreapp1.0": {}

},

"buildOptions": {

"emitEntryPoint": true,

"preserveCompilationContext": true

},

"runtimeOptions": {

"configProperties": {

"System.GC.Server": true

}

},

"publishOptions": {

"include": [

"wwwroot",

"Views",

"Areas/**/Views",

"appsettings.json",

"web.config"

]

}

}

 类似资料: