hey-hoho/ScheduleMasterCore

第一个任务启动成功,其他的都失败了,ERROR:Unable to cast object of type 'generatedProxy_2 to type 'CompanyService.CompanyServiceSoap'.

fgb1990 opened this issue · 2 comments

第一个任务启动成功,其他的都失败了,ERROR:Unable to cast object of type 'generatedProxy_2 to type 'CompanyService.CompanyServiceSoap'.

因为定时任务里有webservice引用,所以把PluginLoadContext 的isCollectible 设置为了false

现在的问题就是,第一个任务启动成功了,其他的任务在运行的时候都会报错(所有任务都在一个压缩包里面)

堆栈错误:
at Hos.ScheduleMaster.Base.TaskBase.InnerRun(TaskContext context) in D:\WorkSpace\任务调度系统ScheduleMasterCore\ScheduleMasterCore\src\ScheduleMasterCore\Hos.ScheduleMaster.Base\TaskBase.cs:line 68 at Hos.ScheduleMaster.Base.TaskContext.InstanceRun() in D:\WorkSpace\任务调度系统ScheduleMasterCore\ScheduleMasterCore\src\ScheduleMasterCore\Hos.ScheduleMaster.Base\TaskContext.cs:line 75 at Hos.ScheduleMaster.QuartzHost.RunnableJob.AssemblyJob.OnExecuting(TaskContext context) in D:\WorkSpace\任务调度系统ScheduleMasterCore\ScheduleMasterCore\src\ScheduleMasterCore\Hos.ScheduleMaster.QuartzHost\RunnableJob\AssemblyJob.cs:line 22 at Hos.ScheduleMaster.QuartzHost.Common.RootJob.InnerRun(IJobExecutionContext context) in D:\WorkSpace\任务调度系统ScheduleMasterCore\ScheduleMasterCore\src\ScheduleMasterCore\Hos.ScheduleMaster.QuartzHost\Common\RootJob.cs:line 69

这个问题应该是和你前一个问题相同的原因,你可以尝试自己升级到.NET5或者.NET6看有没有修复这个问题