Quartz.Net初始化项目 [英] Quartz.Net Initializing Project

查看:376
本文介绍了Quartz.Net初始化项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来Quartz.Net,我一直在关注的本教程的做我的第一份工作。
我也跟着每一步,从零3次开始,但我不能让这个工作。
当我运行Visual Studio中的项目中,我得到了CMD此消息:

I am new to Quartz.Net and I have been following this tutorial to do my first Job. I followed every step and started from zero 3 times but I cannot make this to work. When I run the project on Visual Studio I get this message from the cmd:

Failed: Could not load file or assembly: 'HelloWorldDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

在Visual Studio中的输出获取:

On Visual Studio output I get:

HelloWorldQuartzDotNet.vshost.exe(管理(v4.0.30319)):已加载C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4 .0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll,跳过加载符号。模块进行了优化和调试器选项仅我的代码已启用。
没有发现配置部分 - 抑制记录输出
'HelloWorldQuartzDotNet.vshost.exe(管理(v4.0.30319)):已加载C:\Windows\Microsoft.Net\assembly\GAC_MSIL \System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll'
型的第一个机会异常'System.IO.FileNotFoundException mscorlib.dll中发生

'HelloWorldQuartzDotNet.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. no configuration section found - suppressing logging output 'HelloWorldQuartzDotNet.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Remoting.dll' A first chance exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.dll

我不明白,mscorlib.dll的是什么...我试图寻找这一点,我不能得到任何地方。
我使用Quartz.Net 2.2.1在Windows 8的最新版本。

I cannot understand what that mscorlib.dll is... I tried to search for that and I couldn't get anywhere. I am using the recent version of Quartz.Net 2.2.1 on Windows 8.

推荐答案

下载项目后和下面一步一步的教程,我发现问题了,一个调试器,花了一些时间后。所以教程将指导您从客户端的角度使用 Quartz.NET ,并且有与它没有任何问题。代码正在建设精细化,一切工作就像一个魅力。问题是项目的服务器端,以及错误你正在从运行 Quartz.NET 服务器实现服务发送。行抛出的例外是:

After downloading project and following step-by-step tutorial, I found problem with it, after a some time spent in debugger. So tutorial will guide you from client side perspective on using Quartz.NET, and there are no problems with it. Code is building fine, and everything works like a charm. Problem is on server side of project, and error you are getting is sent from service that is running Quartz.NET server implementation. Line throwing an exception is:

// Line 40 | ScheduleJob.cs
var schedule = schd.ScheduleJob(job, trigger);



这里发生的事情是,调度程序被告知所谓的新的工作 WriteHelloToConsole 实施IJob接口 HelloWorldJob 类。一旦服务器接收到这个信息,他试图找到他的应用领域内的DLL(这里来的问题)。但是,有没有 HelloWorldJob 在Quartz.NET服务器域(文件夹),因为你已经从SourceForge的服务器上下载它。这就是为什么你所得到的无法加载文件或程序集

What's happening here is that scheduler is informed about new job called WriteHelloToConsole for HelloWorldJob class implementing IJob interface. Once server receives this information, he tries to find that dll within his application domain (here comes problem). However, there are no HelloWorldJob in Quartz.NET server domain (folder), since you have downloaded it directly from the SourceForge server. That is reason why you are getting could not load file or assembly.

解决方案是简单的,但不推荐,但对于本教程足够了。你只需要复制/粘贴 HelloWorldQuartzDotNet.exe Quart.NET 服务文件夹,并开始从/停止服务 Windows服务。一旦你这样做,它会加载 HelloWorldJob Quartz.NET 类(以及其他类从HelloWorldQuartzDotNet.exe)服务器应用程序域。

Solution is simple, yet not recommended, but for this tutorial sufficient. You just need to copy/paste HelloWorldQuartzDotNet.exe into the Quart.NET service folder and start/stop service from Windows Services. Once you do this, it will load HelloWorldJob class (and also other classes from HelloWorldQuartzDotNet.exe) in Quartz.NET server application domain.

推荐的解决方案作为其他项目,专门用于生产。创建 Quartz.NET 为每个单独的DLL,所以对 IJob 通过一个DLL类单独的DLL。添加对客户端和复制/粘贴的DLL服务。这样,您将拥有一切脱钩,你会得到维护的解决方案。

Recommended solution for other project, specially for production. Create separate DLL for each of your, so one DLL for IJob class and separate DLL for Quartz.NET. Add references to the client and copy/paste DLLs to service. This way you will have everything decoupled and you will get maintainable solution.

如果您需要更多有关如何.NET应用程序领域的作品,你可以从这个得到它的链接

If you need more about how .NET application domain works, you can get it from this link.

注意:
最好的开始/学习/石英与.NET玩的方式是用自己的文档。有关于如何设置从小型控制台应用程序的窗口服务一个方便的教程。我已实施了好几次,才使用的文档。

Note: Best way to start/learn/play with Quartz .NET is with their documentation. There is a handy tutorial on how to setup everything from small console app to the windows service. I have implemented it several times, only using documentation.

Quartz.NET

我愿意帮助任何特定的问题。

I'm willing to help for any particular question.

这篇关于Quartz.Net初始化项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆