Giter Club home page Giter Club logo

Comments (13)

kevinmatspie avatar kevinmatspie commented on May 24, 2024 1

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.

claudiobottari avatar claudiobottari commented on May 24, 2024

Did you find out? I'm getting the same error....

from hangfire.recurringjobextensions.

 avatar commented on May 24, 2024

No I didn't..was hoping for a response

from hangfire.recurringjobextensions.

icsharp avatar icsharp commented on May 24, 2024

@ChristopherTodd
u can paste your json file content here,it will helpe me to check the error.

from hangfire.recurringjobextensions.

claudiobottari avatar claudiobottari commented on May 24, 2024

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.

icsharp avatar icsharp commented on May 24, 2024

@claudiobottari
Got it!

from hangfire.recurringjobextensions.

 avatar commented on May 24, 2024

Hi @icsharp thanks for getting in touch!

recurringjoberror

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.

icsharp avatar icsharp commented on May 24, 2024

@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.

russosalv avatar russosalv commented on May 24, 2024

@claudiobottari can you explain how you did perform it?

from hangfire.recurringjobextensions.

claudiobottari avatar claudiobottari commented on May 24, 2024

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.

simplysiby avatar simplysiby commented on May 24, 2024

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.

wangboshun avatar wangboshun commented on May 24, 2024

I also encountered this problem. How to solve it? Is there a demo? thank you

from hangfire.recurringjobextensions.

MohammedSafi96 avatar MohammedSafi96 commented on May 24, 2024

@kevinmatspie you're SUUUUUUUPER HEROOOOOOOOOOOOOO,
I got stuck a lot of time thanks

from hangfire.recurringjobextensions.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.