Saturday, March 5, 2011

Ambiguous reference - The type or namespace name 'Quartz' could not be found (are you missing a using directive or an assembly reference?)

Problem:
Environment: VS 2010 .Net 4.0 Console app using Quartz.Net http://quartznet.sourceforge.net/ as a Project Reference.

I would get an Ambiguous reference listing Quartz.IJob twice.

I had only 1 reference to Quarts in the list of References for my Project, that showed up as Quartz.2008.

Compile errors:
Error    1          The type or namespace name 'Quartz' could not be found (are you missing a using directive or an assembly reference?)
Error    5          The type or namespace name 'JobExecutionContext' could not be found (are you missing a using directive or an assembly reference?)  

Quartz Project properties had the target framework set to .NET Framework 3.5.

Solution:
Change the Target framework on the Quartz.2008 project properties to .NET Framework 4.  I ensured my project used .NET Framework 4, also.

If you get the following error in Quartz, then you had set the Target framework to .NET Framework Client Profile instead of .NET Framework 4.

Error    6          The type or namespace name 'HttpContext' could not be found (are you missing a using directive or an assembly reference?)          xxxx\Quartz.NET-1.0.3\src\Quartz\Util\LogicalThreadContext.cs    41        4            Quartz.2008




No comments:

Post a Comment