This project has moved. For the latest updates, please go here.

TaskSchedulerEditor Issues

Oct 19, 2011 at 4:00 PM

ive got this code:

class TaskEditor {

        public TaskEditor() {
            DialogResult res;

            using (TaskService ts = new TaskService()) {
                Task t = ts.GetTask("command");
                TaskEditDialog editorForm = new TaskEditDialog(t, true, true);
                res = editorForm.ShowDialog();
            }
        }
    }

and everything seems fine there, except when it compiles it cant seem to find Microsoft.Win32.TaskSchedulerEditor.

Im using 1.7 and Visual Studio 2010. Ive added the .dll to my references and included the correct using directive, but it doesnt seem to want to work. Any ideas?

Coordinator
Oct 19, 2011 at 11:54 PM

TaskSchedulerEditor is a separate assembly. On the downloads page for 1.7, you also need to extract all the files from the second download (TaskSchedulerEditor.zip) and reference the TaskSchedulerEditor.dll.

On another note, I'd make sure you have retrieved a valid task with the GetTask method before calling the editor.

if (t != null)
Nov 25, 2011 at 8:29 PM

I have the same problem too.  If I want to use TaskService and TaskEditDialog I cannot do it because both have the same name.

Surely I am doing something basic wrong. 

How can I use both assemblies at the same time, in the same .cs ?

Thanks.

Coordinator
Nov 28, 2011 at 5:41 AM

Yes, in fact you must use both in order to use TaskEditDialog. You need to extract all the assemeblies from both downloads and then add them all to your project. There are support assemblies for the TaskSchedulerEditor.dll.

Nov 29, 2011 at 4:16 PM

Sorry but I don't know what to do:

On my WinFormsApplication->References,  I have added;
  -Microsoft.Win32.TaskScheduler
  -Microsoft.Win32.TaskSchedulerEditor

In the source-cs code:

using Microsoft.Win32.TaskScheduler;

But when I try to use it:

TaskEditDialog editForm = new TaskEditDialog();

Both references to class TaskEditDialog are marked with error and when I try to compile it I get:

The type or namespace 'TaskEditDialog' could not be found (are you missing a ......);

 

Coordinator
Nov 30, 2011 at 6:35 AM
  1. From the Downloads page, download the TaskScheduler.zip and TaskSchedulerEditor.zip files and extract all their contents to a folder on your system.
  2. From your project within Visual Studio add references to all the assemblies in that folder
    • Microsoft.Win32.TaskScheduler.dll
    • Microsoft.Win32.TaskSchedulerEditor.dll
    • AeroWizard.dll
    • GroupControls.dll
    • TimeSpan2.dll
    • CubicOrange.Windows.Forms.ActiveDirectory.dll
  3. You should then be able to use any of the classes either using the 'using' directive or by using the full name of the class.

OR

  1. Install NuGet from http://nuget.org/.
  2. Using NuGet from within Visual Studio, add references to the TaskScheduler and TaskSchedulerEditor packages
  3. Enjoy the benefit of having NuGet automatically keep all your assemblies up to date!

 

 

Nov 30, 2011 at 4:57 PM

Thanks for your help David,

I have tried with your step-by-step instructions and with NuGet too, but TaskEditDialog is not "recognized" by my VS2010.  If I remove Microsoft.Win32.TaskScheduler from my "references" list then it right recognize TaskEditDialog but then it doesn't recognize the others (TaskService for example).

 

It is very curious because TaskEditDialog gets the 'ok-color' and when I compile it changes to underline-error-color.

 

Don't worry, perhaps any "collission" with DevExpress or another package.

Thanks again and regards.

Jan 12, 2012 at 10:44 AM

Currently the namespaces of the TaskEditor are a bit confused (Assemblynamespace 'Microsoft.Win32.TaskSchedulerEditor', Defaultnamespace 'Microsoft.Win32.TaskScheduler') and the projects 'TaskEditor' and 'TaskService' are compiled for different dotNET-Versions (TaskEditor: dotNET 3.5, TaskService: dotNET 2.0, That's a bad choice.). Changing that, will solve the problem.

Jan 25, 2012 at 9:50 AM

I have same problem too, i've solved downloading the sources and recompiling targeting .net 4 full, i'have also changed (as CKoewing noticed) the default namespace from 'Microsoft.Win32.TaskScheduler' to 'Microsoft.Win32.TaskSchedulerEditor'.

Feb 27, 2012 at 5:42 PM

Same problem here.  How is this possibly working for anyone?  iLMax's suggestion did not work for me.  Does anyone have updated code for this?

Coordinator
Feb 28, 2012 at 12:05 AM

Make sure the project supports at least .NET 3.5 then follow the steps in my earlier post adding all the assemblies referenced there. I have done this with a number of projects and know this works and doesn't cause namespace collisions. Having different .NET dependencies also is not a problem unless your main executable is .NET 4.0. Then you will see some initial load delays as the .NET 4.0 runtime loads the .NET 3.5 assemblies. You only need to use the single namespace: 

using Microsoft.Win32.TaskScheduler;

If you are missing the controls in the Toolbox, you need to manually add those from the assemblies.

Feb 28, 2012 at 1:51 PM

I'm not sure what else to try.  I guess it must be something on my end, but I don't know what.  I am going to look for another library.  If I solve the issue, I'll post something here.  This is what I did:

1. Extract files from TaskScheduler.zip, and TaskSchedulerEditor.zip (6 dll, 5 xml)
2. Add references to all to my project.
3. Add System.Windows.Forms as a reference (Otherwise I avoid this).
4. Add "using Microsoft.Win32.TaskScheduler;" to usings.
5. Create task service, and loop through tasks, searching for a specific one (called 't').
6. Add the following lines of code:      
   TaskEditDialog editorForm = new TaskEditDialog(t, true, true);   editorForm.ShowDialog();

   The "TaskEditDialog" shows in light blue (my 'OK' color).  No red/blue squigglies.
   If I type "TaskEditD" and invoke intellisense it completes the rest of the  word.
   if I click on "TaskEditDialog" and press F12 it goes to the definition's metadata.

7. Build. Instantly get an error:
     "The type or namespace name 'TaskEditDialog' could not be found (are you missing a using directive or an assembly reference?)"

8. The word now appears with a blue squiggly under it.

 

I also tried changing the namespace of the editor (and all supporting files for it), and the targeted version to .Net 4.0.  No luck.

Coordinator
Feb 28, 2012 at 4:46 PM

I have just included a very simple VS2010 C# project that works. It is at the bottom of this link: http://taskscheduler.codeplex.com/wikipage?title=Install. I hope this helps.