C
C#12mo ago
Kloakk

The entry point of the program is global code; ignoring 'Program.Main(string[])' entry point.

using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using BookingProcessor.Models;


namespace BookingProcessor
{
class Program
{
static void Main(string[] args)
{
var serviceProvider = new ServiceCollection()
.AddDbContext<BookingContext>(options =>
options.UseSqlite("Data Source=booking_data.db"))
.BuildServiceProvider();

// First run in recovery mode to check if there any batch processes outstanding
var recoveryMode = new RecoveryMode(serviceProvider);
recoveryMode.Run().GetAwaiter().GetResult();

// After running in recovery mode, initiate normal mode
var normalMode = new NormalMode(serviceProvider);
normalMode.Run().GetAwaiter().GetResult();

}
}
}
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using BookingProcessor.Models;


namespace BookingProcessor
{
class Program
{
static void Main(string[] args)
{
var serviceProvider = new ServiceCollection()
.AddDbContext<BookingContext>(options =>
options.UseSqlite("Data Source=booking_data.db"))
.BuildServiceProvider();

// First run in recovery mode to check if there any batch processes outstanding
var recoveryMode = new RecoveryMode(serviceProvider);
recoveryMode.Run().GetAwaiter().GetResult();

// After running in recovery mode, initiate normal mode
var normalMode = new NormalMode(serviceProvider);
normalMode.Run().GetAwaiter().GetResult();

}
}
}
Im really not sure why
4 Replies
Thinker
Thinker12mo ago
Do you have any other files? The issue is that you have some file using top-level statements and that is taking precedence over your Main method
Kloakk
KloakkOP12mo ago
Hey sorry for the slow reply. I have quite a few
No description
Kloakk
KloakkOP12mo ago
Im currently running on a version which I KNOW has worked in the past literally like it was running yesterday perfectly
Thinker
Thinker12mo ago
Well, look over whether there's any files with top-level statements, i.e. statements outside the namespace/class.
Want results from more Discord servers?
Add your server