search

Home  >  Q&A  >  body text

My WPF application won't start on another PC, but the application without MySql does, what could be the problem?

This is my first time using a database. I created an application using XAMPP via mySql localhost that contains tables from dbForge. I copied all the files and downloaded the latest 6.0 framework on another PC but it won't start and doesn't give any error message. Additionally, I can see in Task Manager that it opens for a few seconds and then closes.

Also, I tried it with a different application without mySql and the application started. What are some common mistakes I might make? I can provide more information if needed, but right now I don't know what to check.

Connect code blocks:

public class ApplicationDbContext : DbContext
{
    public DbSet<Berletes> Berletesek { get; set; }
   
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
    {
        var connetionString = "Server=localhost; Database=foxgymapp; Uid=root; Pwd=;";
        optionsBuilder.UseMySql(connetionString, ServerVersion.AutoDetect(connetionString));
    }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
    }
}

P粉738046172P粉738046172229 days ago479

reply all(1)I'll reply

  • P粉475126941

    P粉4751269412024-04-04 00:28:56

    The problem you are encountering is that you are trying to access a database that does not exist.

    You are pointing to a database in localhost hosted in your computer, you can run the same database on another computer or expose your database from your computer to another computer .

    reply
    0
  • Cancelreply