diff --git a/QuartzNetWebConsole.sln b/QuartzNetWebConsole.sln index f8be018..70d2b94 100644 --- a/QuartzNetWebConsole.sln +++ b/QuartzNetWebConsole.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.31101.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CAD78976-5F87-4988-BC1D-E3E70398F7CD}" ProjectSection(SolutionItems) = preProject .nuget\NuGet.Config = .nuget\NuGet.Config @@ -10,15 +12,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{CAD789 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuartzNetWebConsole", "QuartzNetWebConsole\QuartzNetWebConsole.csproj", "{72A7A322-38DD-47DD-8948-6ED6E2F9DC5D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp", "SampleApp\SampleApp.csproj", "{F2832947-64D9-4B0A-A0BD-DDE7E90AC968}" - ProjectSection(ProjectDependencies) = postProject - {72A7A322-38DD-47DD-8948-6ED6E2F9DC5D} = {72A7A322-38DD-47DD-8948-6ED6E2F9DC5D} - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuartzNetWebConsole.Tests", "QuartzNetWebConsole.Tests\QuartzNetWebConsole.Tests.csproj", "{05021F00-C4D1-45C3-92EC-92C467B74F67}" EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "QuartzNetWebConsole.Views", "QuartzNetWebConsole.Views\QuartzNetWebConsole.Views.vbproj", "{7961AB01-1549-4340-8D3D-F0DA43B8C84F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp", "SampleApp\SampleApp.csproj", "{AA2D041C-4CDC-4055-8FC5-C0ECD4D8AE48}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -29,10 +28,6 @@ Global {72A7A322-38DD-47DD-8948-6ED6E2F9DC5D}.Debug|Any CPU.Build.0 = Debug|Any CPU {72A7A322-38DD-47DD-8948-6ED6E2F9DC5D}.Release|Any CPU.ActiveCfg = Release|Any CPU {72A7A322-38DD-47DD-8948-6ED6E2F9DC5D}.Release|Any CPU.Build.0 = Release|Any CPU - {F2832947-64D9-4B0A-A0BD-DDE7E90AC968}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F2832947-64D9-4B0A-A0BD-DDE7E90AC968}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F2832947-64D9-4B0A-A0BD-DDE7E90AC968}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F2832947-64D9-4B0A-A0BD-DDE7E90AC968}.Release|Any CPU.Build.0 = Release|Any CPU {05021F00-C4D1-45C3-92EC-92C467B74F67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {05021F00-C4D1-45C3-92EC-92C467B74F67}.Debug|Any CPU.Build.0 = Debug|Any CPU {05021F00-C4D1-45C3-92EC-92C467B74F67}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -41,6 +36,10 @@ Global {7961AB01-1549-4340-8D3D-F0DA43B8C84F}.Debug|Any CPU.Build.0 = Debug|Any CPU {7961AB01-1549-4340-8D3D-F0DA43B8C84F}.Release|Any CPU.ActiveCfg = Release|Any CPU {7961AB01-1549-4340-8D3D-F0DA43B8C84F}.Release|Any CPU.Build.0 = Release|Any CPU + {AA2D041C-4CDC-4055-8FC5-C0ECD4D8AE48}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AA2D041C-4CDC-4055-8FC5-C0ECD4D8AE48}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AA2D041C-4CDC-4055-8FC5-C0ECD4D8AE48}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AA2D041C-4CDC-4055-8FC5-C0ECD4D8AE48}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SampleApp/Default.aspx b/SampleApp/Default.aspx deleted file mode 100644 index 511add5..0000000 --- a/SampleApp/Default.aspx +++ /dev/null @@ -1,16 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SampleApp._Default" %> - - - - - - - - -
-
- -
-
- - diff --git a/SampleApp/Default.aspx.cs b/SampleApp/Default.aspx.cs deleted file mode 100644 index d72d1d6..0000000 --- a/SampleApp/Default.aspx.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace SampleApp -{ - public partial class _Default : System.Web.UI.Page - { - protected void Page_Load(object sender, EventArgs e) - { - Response.Redirect("/quartz/index.ashx"); - } - } -} diff --git a/SampleApp/Default.aspx.designer.cs b/SampleApp/Default.aspx.designer.cs deleted file mode 100644 index 20b2c12..0000000 --- a/SampleApp/Default.aspx.designer.cs +++ /dev/null @@ -1,27 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.42 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace SampleApp -{ - - - public partial class _Default - { - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - } -} diff --git a/SampleApp/Global.asax b/SampleApp/Global.asax index 77b4390..4f4fd30 100644 --- a/SampleApp/Global.asax +++ b/SampleApp/Global.asax @@ -1 +1 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="SampleApp.Global" Language="C#" %> +<%@ Application Codebehind="Global.asax.cs" Inherits="SampleApp.MvcApplication" Language="C#" %> diff --git a/SampleApp/Global.asax.cs b/SampleApp/Global.asax.cs index d9af062..f30d103 100644 --- a/SampleApp/Global.asax.cs +++ b/SampleApp/Global.asax.cs @@ -1,21 +1,15 @@ using System; using System.Web; +using System.Web.Routing; using Quartz; using Quartz.Impl; using QuartzNetWebConsole; namespace SampleApp { - public class Global : HttpApplication { - - static readonly HttpRequest InitialRequest; - - static Global() { - // Workaround to fix error "Request is not available in this context" with IIS7 or IIS Express - // http://sammyageil.com/post/Request-is-not-available-in-this-context-exception-in-Globalasaxs-Application_Start-IIS-7-Integrated-mode - InitialRequest = HttpContext.Current.Request; - } - - protected void Application_Start(object sender, EventArgs e) { + // Note: For instructions on enabling IIS6 or IIS7 classic mode, + // visit http://go.microsoft.com/?LinkId=9394801 + public class MvcApplication : System.Web.HttpApplication { + void Application_Start() { // First, initialize Quartz.NET as usual. In this sample app I'll configure Quartz.NET by code. var schedulerFactory = new StdSchedulerFactory(); var scheduler = schedulerFactory.GetScheduler(); @@ -24,9 +18,6 @@ protected void Application_Start(object sender, EventArgs e) { // This tells the QuartzNetWebConsole what scheduler to use Setup.Scheduler = () => scheduler; - // This adds an logger to the QuartzNetWebConsole. It's optional. - var partialQuartzConsoleUrl = string.Format("http://{0}:{1}/quartz/", InitialRequest.Url.Host, InitialRequest.Url.Port); - Setup.Logger = new MemoryLogger(1000, partialQuartzConsoleUrl); // I'll add some global listeners scheduler.ListenerManager.AddJobListener(new GlobalJobListener()); @@ -39,7 +30,7 @@ protected void Application_Start(object sender, EventArgs e) { .WithIntervalInSeconds(6)) .StartNow() .Build(); - var job = new JobDetailImpl("myJob", null, typeof (HelloJob)); + var job = new JobDetailImpl("myJob", null, typeof(HelloJob)); scheduler.ScheduleJob(job, trigger); // A cron trigger and job @@ -52,19 +43,28 @@ protected void Application_Start(object sender, EventArgs e) { scheduler.ScheduleJob(cron); // A dummy calendar - scheduler.AddCalendar("myCalendar", new DummyCalendar {Description = "dummy calendar"}, false, false); + scheduler.AddCalendar("myCalendar", new DummyCalendar { Description = "dummy calendar" }, false, false); + RouteTable.Routes.Add(new R()); } - protected void Session_Start(object sender, EventArgs e) {} - - protected void Application_BeginRequest(object sender, EventArgs e) {} - - protected void Application_AuthenticateRequest(object sender, EventArgs e) {} - - protected void Application_Error(object sender, EventArgs e) {} - - protected void Session_End(object sender, EventArgs e) {} - - protected void Application_End(object sender, EventArgs e) {} + private class R : RouteBase { + private static readonly Lazy initLogger = new Lazy(() => { + // This adds an logger to the QuartzNetWebConsole. It's optional. + var partialQuartzConsoleUrl = string.Format("http://{0}:{1}/quartz/", HttpContext.Current.Request.Url.Host, HttpContext.Current.Request.Url.Port); + Setup.Logger = new MemoryLogger(1000, partialQuartzConsoleUrl); + return null; + }); + + public override RouteData GetRouteData(HttpContextBase httpContext) { + var _ = initLogger.Value; + if (httpContext.Request.Url.PathAndQuery == "/") + httpContext.Response.Redirect("/quartz/index.ashx", endResponse: true); + return null; + } + + public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) { + throw new NotImplementedException(); + } + } } } \ No newline at end of file diff --git a/SampleApp/Properties/AssemblyInfo.cs b/SampleApp/Properties/AssemblyInfo.cs index 039f556..ce93168 100644 --- a/SampleApp/Properties/AssemblyInfo.cs +++ b/SampleApp/Properties/AssemblyInfo.cs @@ -8,9 +8,9 @@ [assembly: AssemblyTitle("SampleApp")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyCompany("")] [assembly: AssemblyProduct("SampleApp")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -20,7 +20,7 @@ [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] +[assembly: Guid("b13b6624-5506-4db3-8661-88816e5e3f7c")] // Version information for an assembly consists of the following four values: // diff --git a/SampleApp/SampleApp.csproj b/SampleApp/SampleApp.csproj index 8506cd0..21cfc58 100644 --- a/SampleApp/SampleApp.csproj +++ b/SampleApp/SampleApp.csproj @@ -1,30 +1,27 @@  - + Debug AnyCPU - 9.0.30729 + + 2.0 - {F2832947-64D9-4B0A-A0BD-DDE7E90AC968} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + {AA2D041C-4CDC-4055-8FC5-C0ECD4D8AE48} + {E3E379DF-F4C6-4180-9B81-6769533ABE47};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties SampleApp SampleApp - v3.5 - - - - - 4.0 - false - ..\ - true + v4.5.1 + false + true + ..\ + true true @@ -46,39 +43,26 @@ False - ..\packages\Common.Logging.3.0.0\lib\net35\Common.Logging.dll + ..\packages\Common.Logging.3.0.0\lib\net40\Common.Logging.dll - - ..\packages\Common.Logging.Core.3.0.0\lib\net35\Common.Logging.Core.dll - - + False - ..\packages\Quartz.2.3.2\lib\net35\Quartz.dll + ..\packages\Common.Logging.Core.3.0.0\lib\net40\Common.Logging.Core.dll - + False - ..\QuartzNetWebConsole\Build\QuartzNetWebConsole.dll + ..\packages\Quartz.2.3.2\lib\net40\Quartz.dll - - 3.5 - + + + + + - - - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - Global.asax @@ -89,11 +73,24 @@ - + + + + Web.config + + + Web.config + + + + {72a7a322-38dd-47dd-8948-6ed6e2f9dc5d} + QuartzNetWebConsole + + Designer @@ -106,23 +103,18 @@ - - False + True True - 39255 + 61402 / - - + http://localhost:39255/ False False @@ -132,5 +124,17 @@ - + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/SampleApp/Web.Debug.config b/SampleApp/Web.Debug.config new file mode 100644 index 0000000..a83c1d4 --- /dev/null +++ b/SampleApp/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/SampleApp/Web.Release.config b/SampleApp/Web.Release.config new file mode 100644 index 0000000..658b48e --- /dev/null +++ b/SampleApp/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/SampleApp/Web.config b/SampleApp/Web.config index 40ffc13..b50a5cd 100644 --- a/SampleApp/Web.config +++ b/SampleApp/Web.config @@ -1,113 +1,18 @@  - - - -
- -
-
-
-
- - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - \ No newline at end of file + diff --git a/SampleApp/packages.config b/SampleApp/packages.config index abd428b..ec45e86 100644 --- a/SampleApp/packages.config +++ b/SampleApp/packages.config @@ -1,6 +1,6 @@  - - - + + + \ No newline at end of file