Hangfire Discussion

Can not change the state to 'Enqueued': target method was not found


#1

Please help.

Can not change the state to ‘Enqueued’: target method was not found.

System.IO.FileNotFoundException

Could not load file or assembly ‘App_Web_dqe0holx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified.

System.IO.FileNotFoundException: Could not load file or assembly ‘App_Web_dqe0holx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. The system cannot find the file specified. File name: ‘App_Web_dqe0holx, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null’ at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type) at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName) at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) at Hangfire.Storage.InvocationData.DefaultTypeResolver(String typeName) at Hangfire.Storage.InvocationData.Deserialize()


#2

You’re going to need at least include what method you were trying to call.


#3

Hi can you check once below code.

GlobalConfiguration.Configuration.UseStorage(
new MySqlStorage(
connectionString,
new MySqlStorageOptions
{
TransactionIsolationLevel = System.Data.IsolationLevel.ReadCommitted,
QueuePollInterval = TimeSpan.FromSeconds(15),
JobExpirationCheckInterval = TimeSpan.FromHours(1),
CountersAggregateInterval = TimeSpan.FromMinutes(5),
PrepareSchemaIfNecessary = true,
DashboardJobListLimit = 50000,
TransactionTimeout = TimeSpan.FromMinutes(1),

}));

    BackgroundJob.Enqueue(() => bgscheduler.SchedularGeneratefiles(bgThread.BusinesspartnerId, bgThread.LoginID,
             ThreadId, PageName, Sourepath, StartDate, endDate, FEIN, Paycode, bgThread.SourceLink));
        var hangjobid = BackgroundJob.Schedule(() => bgscheduler.SchedularGeneratefiles(bgThread.BusinesspartnerId, bgThread.LoginID,
               ThreadId, PageName, Sourepath, StartDate, endDate, FEIN, Paycode, bgThread.SourceLink),
             TimeSpan.FromMilliseconds(1000));
       
            RecurringJob.AddOrUpdate("Tax-return Clent Package", () => bgscheduler.SchedularGeneratefiles(bgThread.BusinesspartnerId, bgThread.LoginID,
             ThreadId, PageName, Sourepath, StartDate, endDate, FEIN, Paycode, bgThread.SourceLink),Cron.MinuteInterval(10) , TimeZoneInfo.Local);//"45 11 26 2 *", TimeZoneInfo.Utc);