last day (15 days later) » 

7:26 PM
0
A: No suitible method found for generated overrides

André SansonI'm assuming protected QueueTaskChildJob(QueueItemType queueItem, Dictionary<QueueItemType, CancellationTokenSource> parentCancellationSources); is the constructor and you made a typo with the ; instead of using { } To solve this problem you have to generate the constructor of the Testjob to use...

 
No that's just a library file generated from the DLL that imported, i'll update the code with the code from that DLL too
 
C#/VB class library project generate dll file but the good practise is to add reference instead of importing DLL. Is this DLL an unmanaged C/C++ or C# code?
 
Maybe I'm importing references wrong, I thought a DLL was used as a reference in C# I'm building the CS files for the job classes as a Class Library project in VS, and then using the resulting DLL and adding it to 'References' under the solution explorer of the new project. It should be c# code
 
I guess I'm missing background on how DLLs work, I though c# was always managed code.
 
7:26 PM
C# is managed. I was asking if your DLL happen to be unmaged.
 
I think it's managed then, it's just C# code built into a DLL
 
ok, I was trying to clarify because when I copy your code it doesn't not compile because of the constructor protected TestChildQueueJob();
I managed to get it working by generating the constructor of testjob
 
That makes sense yea. The CS version one is the actual code I wrote. The Library version is what I see after I add the build dll to the other project and check the definitions of those classes
hmmm really?
if I add `

testjob() : base() { }` to testjob it doesn't work for me
wait do you mean the base constructor on TestChildQueueJob?
 
yes
protected TestChildQueueJob(); is a constructor
it needs to be protected TestChildQueueJob() { }
no ; at the end
if you make that change you may be able to compile the testjob
 
I don't think you get what I mean, that's not a file I can edit
that's just an auto-generated definition based on the DLL contents
 
7:33 PM
yea I don't understand then
 
```namespace MeepTech.Jobs {

/// <summary>
/// Child job for doing work on objects in the queue
/// </summary>
public abstract class TestChildQueueJob<QueueItemType> {

/// <summary>
/// The do work function
/// </summary>
/// <param name="queueItem"></param>
/// <param name="cancellationToken"></param>
protected abstract void doWork(QueueItemType queueItem, CancellationToken cancellationToken);
}
}```
this is the base file
if I hit control b, and then take the produced DLL and add that to a new project, it looks like this:
namespace MeepTech.Jobs {
public abstract class TestChildQueueJob<QueueItemType> : ThreadedJob {
protected TestChildQueueJob();

protected abstract void doWork(QueueItemType queueItem, CancellationToken cancellationToken);
}
}
It's just a generated definition of the imported code from the DLL
 
alright
public testjob() : base() { } does not work?
 
no
here's the thing, this DOES work:
namespace MeepTech.Jobs {

/// <summary>
/// Child job for doing work on objects in the queue
/// </summary>
public abstract class TestChildQueueJob<QueueItemType> {

/// <summary>
/// The do work function
/// </summary>
/// <param name="queueItem"></param>
/// <param name="cancellationToken"></param>
protected abstract void doWork(QueueItemType queueItem, CancellationToken cancellationToken);
}

class testjob : TestChildQueueJob<int> {

protected override void doWork(int queueItem, CancellationToken cancellationToken) {
it only seems to not work if i import the class from DLL
 
I just made a test and it worked for me
I created a class library and compile it
in the other project I choose add reference and browsed the dll in the bin/debug
it worked
 
so you compiled this code:
namespace MeepTech.Jobs {

/// <summary>
/// Child job for doing work on objects in the queue
/// </summary>
public abstract class TestChildQueueJob<QueueItemType> {

/// <summary>
/// The do work function
/// </summary>
/// <param name="queueItem"></param>
/// <param name="cancellationToken"></param>
protected abstract void doWork(QueueItemType queueItem, CancellationToken cancellationToken);
}
}
into a DLL, and were able to add it as a reference, extend it, and add doWork as a function?
 
7:42 PM
yes
 
Can i see the generated code?
Like the definition like I posted?
 
#region Assembly ClassLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// c:\users\andre.sanson\documents\visual studio 2015\Projects\ConsoleTeste\ClassLibrary1\bin\Debug\ClassLibrary1.dll
#endregion

using System.Threading;

namespace ClassLibrary1
{
public abstract class QueueTaskChildJob<QueueItemType> : ThreadedJob
{
protected QueueItemType queueItem;

protected QueueTaskChildJob();

protected abstract void doWork(QueueItemType queueItem, CancellationToken cancellationToken);
I created 2 solutions
1 with the QueueTaskChildJob
and another visual studio with a console application that I imported the dll directly
something that came as a erro was CancellationToken
I had to import system.threading
 
So I saved the file as a .cs file in the root of the project.
I pressed ctrl+B, build said 1 succeeded.

I go into bin/debug/netcoreapp3.0 get the .dll

In my new solution, I right click 'references' in the solution explorer and add the .dll file
 
other than that all went fine
yes
did that
visual studio 2015
 
could you try with the test class I made?
Where did you get threadedjob from? did you just make a fake?
 
7:47 PM
yes
i created a fake
send the dll
 
oh?
 
not sure
but it might be the CancellationToken
what .net version you compiled the QueueTaskChildJob?
 
8
oh well it's c# 8, should be net core 3
 
7:59 PM
i dont have net core here
my max is 4.6.1
 
oh maybe that was it
 
can you check both your projects have the same .net version?
 
so class library .net core is what I used,
hmmm it's possible the job one was on a lower one than what i'm importing into
 
if they're the same ill remove my answear and think more about it
was it the same .net version?
soon ill have to leave
ill be back just ins 2hrs~
 
targetFramework of the new project is v4.5 atm
targetFramework of the class library is
<TargetFramework>netcoreapp3.0</TargetFramework>
so maybe that's it
 
8:03 PM
yea
the threading class changed in .net core
they are not the same object
lower both version
i mean
lower the one with the .net core
ill remove my answear for now
I gotta leave
if anything new pops send here or edit the question, ill keep an eye in my phone as i get home
 
8:29 PM
Thanks again!
 

last day (15 days later) »