Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

480
Views
No se puede convertir de 'cadena' a 'Microsoft.EntityFrameworkCore.ServerVersion

Estoy usando C# y tengo un error: Argument 2: cannot convert from 'string' to 'Microsoft.EntityFrameworkCore.ServerVersion'

 using Microsoft.EntityFrameworkCore; using System; namespace Infrastructure { public class BotContext : DbContext { public DbSet<Server> Servers { get; set; } protected override void OnConfiguring(DbContextOptionsBuilder options) => options.UseMySql("server=localhost;user=root;port=3306;Connect Timeout=5;"); public class Server { public ulong Id { get; set; } public string Prefix { get; set; } } } }
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

public class BotContext : DbContext { public DbSet<Server> Servers { get; set; } public BotContext() { Database.EnsureCreated(); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseMySql( "server=localhost;user=root;port=3306;Connect Timeout=5;", new MySqlServerVersion(new Version(8, 0, 11)) ); } public class Server { public ulong Id { get; set; } public string Prefix { get; set; } } }

Esto debería ayudar: https://metanit.com/sharp/entityframeworkcore/7.2.php

over 4 years ago · Santiago Trujillo Report

0

Aparentemente, la nueva versión de Pomelo necesita más argumentos. Una solución simple es agregar una clase de Version vacía como esta en startup.cs:

 services.AddDbContext<ApplicationDB>(options => options.UseMySql(Configuration.GetConnectionString("DefaultConnection"), new MySqlServerVersion(new Version())));
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!