Thursday, March 26, 2009

Getting Started With Quartz.Net: Part 1

NOTE: I'm now blogging at http://jayvilalta.com/blog and not updating this blog anymore. For information on the latest version of Quartz.Net, visit me there.

In this series of posts I will try to help you get started using Quartz.Net, the C# port of Quartz. This tutorial assumes that you are using the latest version of the .Net framework, so if you are using a different version, make sure you adapt the instructions accordingly. Also, I assume that you are somewhat familiar with installing and managing windows services.
This first installment will walk you through installing Quartz.Net as a standalone windows service.
1. Download the latest version (which at this time is 1.o) zip file from http://quartznet.sourceforge.net/download.html. Unzip the file to any temporary folder (I’m using C:\Temp\Quartz for the example). We will not be keeping this folder (unless you want to).
2. Locate the C:\temp\Quartz\server\bin\3.5\service folder. It contains all the files that you need to install the service.
quartzfiles
3. Copy all the files in this folder to the folder that will serve as your Quartz server installation folder. I will use C:\Quartz as my installation folder.
4. Once you have copied all the files there, it is time to install the service. We will use installutil.exe to do this. The easiest way to run the installer is to open a Visual Studio Command Prompt and navigate to C:\Quartz (or your install folder). If you’re running Vista or Windows 7, you’ll need to run the command prompt as Administrator (thanks sashas and max). Then run the following command to install the service:
installutil Quartz.Server.Service.exe
installPrompt
5. If the install ran successfully, you will have a screen that looks like this:
installSuccess
At this point the service should be installed. Open the services manager and change the account and startup type if necessary.
Part 2 of this series will discuss how to configure and start the Quartz.net server.

21 comments:

sashas said...

I am getting the following when trying to use the installutil:

Creating EventLog source QuartzServer in log Application...

An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

The Rollback phase of the installation is beginning.
See the contents of the log file for the c:\Quartz\Quartz.Server.Service.exe assembly's progress.

sashas said...

Found a resolution to the issue: in Vista you must run the VS Command Prompt as an Administrator (right-click and press 'Run As Administrator').

max said...

Thx sashas, had the same error in windows 7 and the solution is to run VS Command Propmt as Administratior too.

J said...

Thanks for the feedback, I've updated the post to reflect the need to run installutil as administrator on Vista and Windows 7.

Rytis Usalis said...

Hello, thanks for brief description.

J said...

You're welcome. Thanks for stopping by.

Jous said...

Hi,

could you tell me where to find the QuartzService logs??? I installed everything but I can't see the logs output anywhere... I left the log configuration as I found it but I just get log

thx in advance

J said...

By default everything gets logged in the windows event log.

Anonymous said...

I am getting the following error when trying to use the installutil
can any one help me to solve this problem.Thanks in advanced

Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Quartz\
Quartz.Server.Service.exe' or one of its dependencies. Operation is not supporte
d. (Exception from HRESULT: 0x80131515).

Hoyt said...

I am getting the same error as the last post, after opening the Visual Studio 2010 command prompt as Administrator.

Hint?

Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Quartz\
Install Service\Quartz.Server.Service.exe' or one of its dependencies. Operation

is not supported. (Exception from HRESULT: 0x80131515).

Anonymous said...

If you have only Visual Studio 2010 on your machine, you will not be able to use the Visual Studio 2010 Command Prompt to install Quartz (as previously mentioned by other users.

With that said, you can download Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1 if you have Windows 7 at http://www.microsoft.com/downloads/en/details.aspx?familyid=71DEB800-C591-4F97-A900-BEA146E4FAE1&displaylang=en and use the CMD Shell to use installutil to install Quartz.

Hopefully this helps someone out there...

J said...

I have personally never run into this issue and I have installed Quartz.Net on Windows XP, Vista, 2K3, 2K8 and 7 with no issues. However, I realize not all OSes are setup the same way so thanks for coming back and posting your solution.

Your Blog said...

I am also getting FILE NOT FOUND EXCEPTION. The same as some guys are having. I ma using Win-XP and unable to find any solution for that.

Any help will be highly appreciated.

Thanks in advance.

Your Blog said...

I am trying to install Quartz.net as a stand alone windows-service through Visual Studio command prompt an getting this error:
System.IO.FileLoadException: Could not load file or assembly 'file://C:\Quartz\Quartz.Server.Service.exe' or one of its dependencies. Operation is not supported. .

Can anyone tell me what it is and how to rectify this error. I am using Visual studio command prompt 2010 and OS is windows-XP

Your Blog said...

I am trying to install Quartz.net as a stand alone windows-service through Visual Studio command prompt an getting this error:
System.IO.FileLoadException: Could not load file or assembly 'file://C:\Quartz\Quartz.Server.Service.exe' or one of its dependencies. Operation is not supported. .

Can anyone tell me what it is and how to rectify this error. I am using Visual studio command prompt 2010 and OS is windows-XP

J said...

@YourBlog, the answer is in the comment by Anonymous on Feb 4th.

Your Blog said...

I tried installing that exe file through Visual studio command prompt 2008 and it worked. Now I can see Quartz.Server in my windows services list. Thank J your blog helped me a lot to succeed.
One more thing, we have to manually restart Quartz server every time a new job is added. This is some what impractical. Do you have any way so that configuration file(XML) will get compiled and quartz server get restarted automatically whenever a new job is added to it for scheduling in it or if anyway we are able to recompile XML file periodically and when changed detected, quartz server should get restarted itself??????

Thanks in advance..

Akki J

Your Blog said...

Is there any way that we can extend Quartz functionality so that if our job class contains suppose 4 functions, we can specify in tag which one we want to fire. The intention is to avoid using Execute method. Is there any way so that we can specify function name also together with Job Class name in tag.

Your Blog said...

Hello all,

Is there any way to define say 4 functions in our job class(the class that is inheriting IJob interface) and use them dynamically in quartz_jobs.xml file.
Right now the only way is to put business logic in Execute method. But i want to define my own methods and use that name in tag. Like say I defined 2 methods SendMail1() and SendMail2() and no execute method is there in my job class. Now I want to call it like: ClassLibrary1.Class1.SendMail1, ClassLibrary1

Requirement is urgent. If anybody has any idea, please send it

Thanks in advance,
Akki J

Isan said...

I'm using Windows 7 and VS2010 and got the same error:

Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Quartz\
Install Service\Quartz.Server.Service.exe' or one of its dependencies. Operation

is not supported. (Exception from HRESULT: 0x80131515).

The Windows SDK wasn't helpful, but I've found the problem: Windows blocked the file since it came from a different computer.

Right-Click the "Quartz.Server.Service.exe" file and enter the properties, you'll see a button "Unblock".

Done. Now you can try to install it again e certainly you'll succeed!

Anonymous said...

In the latest file the installation file has the name Quartz.Server.exe.
Giving the right name installed the file.