Hirdetés

2024. május 2., csütörtök

Gyorskeresés

Hozzászólások

(#9997) Keem1


Keem1
addikt

Srácok, ebben kérnék helpet.
Részletek: .NET 6.0 console, VS Code

Output Windowson:
NewGen v1.1.124.1223
Album
Artist
Customer
Employee
Genre
Invoice
InvoiceLine
MediaType
Playlist
PlaylistTrack
Track
Press any key...

Output Linuxon:
NewGen v1.1.124.1223
Unhandled exception. System.IO.FileLoadException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The located assembly's manifest definition does not match the assembly reference. (0x80131040)
File name: 'System.Diagnostics.DiagnosticSource, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at MySql.Data.MySqlClient.MySqlConnection.OpenAsync(Boolean execAsync, CancellationToken cancellationToken)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
at MySql.Data.MySqlClient.MySqlConnection.OpenAsync(Boolean execAsync, CancellationToken cancellationToken)
at MySql.Data.MySqlClient.MySqlConnection.Open()
at NewGen.NewGenHelper.MySQLHelper.Tables() in C:\Users\kincs\source\repos\NewGen\NewGenHelper.cs:line 193
at NewGen.NewGen.Main() in C:\Users\kincs\source\repos\NewGen\Program.cs:line 34
Félbeszakítva

Kód:
public List<string> Tables()
{
var tables = new List<string>();
using (var conn = new MySqlConnection(ConnectionString))
{
conn.Open();
using(var cmd = new MySqlCommand())
{
cmd.Connection = conn;
cmd.CommandText = "SHOW TABLES;";
var reader = cmd.ExecuteReader().Cast<IDataRecord>();
tables = reader.Select(x => x.GetString(0).ToString()).ToList();
}
conn.Close();
}
return tables;
}

Mi okozhatja az exceptiont Linuxon úgy, hogy Windowson nem?
Így fordítottam: dotnet publish -c Release --arch arm --os linux

Előre is köszi :R

[ Szerkesztve ]

Copyright © 2000-2024 PROHARDVER Informatikai Kft.