Comments (13)
If anyone else runs into this issue, here is what solved it for me: Use the AssemblyQualifiedName property to discover the full name of your class and use that in the job-type property. I added this bit of code in my startup before attempting to do anything with Hangfire:
string myTask = typeof(MyTask).AssemblyQualifiedName
I examined "myTask" in the debugger and that gave me a string that looked like: "MyTaskProject.Tasks.MyTask, MyTask, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
That string satisfied the type conversion. I found that it still worked after removing the Version, Culture and PublicKeyToken attributes, so my final job-type value ended up being: "MyTaskProject.Tasks.MyTask, MyTask"
.
from hangfire.recurringjobextensions.
Did you find out? I'm getting the same error....
from hangfire.recurringjobextensions.
No I didn't..was hoping for a response
from hangfire.recurringjobextensions.
@ChristopherTodd
u can paste your json file content here,it will helpe me to check the error.
from hangfire.recurringjobextensions.
Since it was urgent to me to fix this... I changed the receiving object definition for the property that gave me this error (from System.Type to string) to avoid this exception. It's a workaround that you may use as well...
from hangfire.recurringjobextensions.
@claudiobottari
Got it!
from hangfire.recurringjobextensions.
Hi @icsharp thanks for getting in touch!
we are using:
"HangFire" Version: 1.6.17
"Microsoft.AspNetCore" Version= 2.0.1
please see a pic of the error we have recreated and please find the json below:
[
{
"job-name": "My Job1",
"job-type": "Hangfire.Samples.MyJob1, Hangfire.Samples",
"cron-expression": "*/1 * * * ",
"timezone": "China Standard Time",
},
{
"job-name": "My Job2",
"job-type": "Hangfire.Samples.MyJob2, Hangfire.Samples",
"cron-expression": "/5 * * * ",
"job-data": {
"IntVal": 1,
"StringVal": "abcdef",
"BooleanVal": true,
"SimpleObject": {
"Name": "Foo",
"Age": 100
}
}
},
{
"job-name": "Long Running Job",
"job-type": "Hangfire.Samples.LongRunningJob, Hangfire.Samples",
"cron-expression": "/2 * * * *",
"job-data": {
"RunningTimes": 300
}
}
]
from hangfire.recurringjobextensions.
@ChristopherTodd
see unit test I added ,it passed. Maybe you can serialize RecurringJobJsonOptions instance and get the job-type
string as @claudiobottari said .
from hangfire.recurringjobextensions.
@claudiobottari can you explain how you did perform it?
from hangfire.recurringjobextensions.
Hi there and sorry for the late reply. Since there's clearly an issues on deserializing certain types, I worked around this limitation updating the property which raised the exception to be a simple string... that was enough to make the serialization/deserialization work. At that point I converted by myself the string to the required type. Is is clear?
from hangfire.recurringjobextensions.
Hi Guys.. I was getting this error while setting up a simple project.. The actual recurring job was a new project in the same solution.
The fix was simply to add the project as a reference in the parent project. (Right click the parent project references > Add reference > Select the recurringjob Project)
Hope this helps somebody !
from hangfire.recurringjobextensions.
I also encountered this problem. How to solve it? Is there a demo? thank you
from hangfire.recurringjobextensions.
@kevinmatspie you're SUUUUUUUPER HEROOOOOOOOOOOOOO,
I got stuck a lot of time thanks
from hangfire.recurringjobextensions.
Related Issues (13)
- RecurreingJobAttribute timezoneInfo not supported HOT 2
- Jobs getting enqueued but not executed HOT 2
- Unable to use context.GetJobData in any case HOT 3
- ASP.Net 4.6 Compatibility?
- IRecurringJob Async Task Execute(PerformContext context) IRecurringJob
- Providercontext is null
- Inject Dependency to constructor
- recurringjob.json文件中Type类型转换 .net6.0
- Same job type with different job-data skipped HOT 9
- 向大神提2个建议 HOT 3
- No way to use base class for a job HOT 1
- DependencyInjection inside Job HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hangfire.recurringjobextensions.