Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:10:09+00:00 2026-06-15T03:10:09+00:00

my code works on form application well but same code doesnt work on windows

  • 0

my code works on form application well but same code doesnt work on windows service !


OnStart

protected override void OnStart(string[] args)
{
    try
    {

        // First we must get a reference to a scheduler
        ISchedulerFactory sf = new StdSchedulerFactory();
        IScheduler sched = sf.GetScheduler();

        // get a "nice round" time a few seconds in the future...
        DateTimeOffset startTime = DateBuilder.NextGivenSecondDate(null, 15);

        // job1 will only fire once at date/time "ts"
        IJobDetail job = JobBuilder.Create<SimpleJob>()
            .WithIdentity("job1", "group1")
            .Build();

        ISimpleTrigger trigger = (ISimpleTrigger)TriggerBuilder.Create()
                                                      .WithIdentity("trigger1", "group1")
                                                      .StartAt(startTime)
                                                      .WithSimpleSchedule(x => x.WithIntervalInSeconds(60).RepeatForever())
                                                      .Build();

        // Tell quartz to schedule the job using our trigger
        sched.ScheduleJob(job, trigger);

        // Start up the scheduler (nothing can actually run until the 
        // scheduler has been started)
        sched.Start();
    }
    catch (Exception x)
    {
        Operation.Logger.Error("Servis başlatma hatası: "+x.StackTrace);

    }

}

IJob

public class SimpleJob : IJob
{
    bool inProgress = false;
    public virtual void Execute(IJobExecutionContext context)
    {
        if (!inProgress)
        {
            try
            {

                inProgress = true;

                Incoming incomingFiles = new Incoming();
                incomingFiles.Start();


                Outgoing outgoingFiles = new Outgoing();
                outgoingFiles.Start();

                inProgress = false;

            }
            catch (Exception x)
            {
                Operation.Logger.Error("f8job çalışma hatası: "+ x.Message);
                inProgress = false;
            }
        }


    }
}

ERROR

    System.IO.FileNotFoundException: Could not load file or assembly 'Common.Logging,    Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e' or one of its dependencies. The system cannot find the file specified.
File name: 'Common.Logging, Version=2.0.0.0, Culture=neutral, PublicKeyToken=af08829b84f0328e'
   at Quartz.Impl.StdSchedulerFactory..cctor()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:10:11+00:00Added an answer on June 15, 2026 at 3:10 am

    Try configuring your service to run in the Windows account where your code runs normally.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code works anywhere else.. form load, button click, etc. But when I add
This code works well for displaying separate xml items in my main.xml. But is
This is my encryption/decryption code. It works well but crashes when it encrypts a
I have this code in my cfm, which works <cfif not StructIsEmpty(form)> <cfset larray
This code works well: UIDatePicker *pickerView = [[UIDatePicker alloc] initWithFrame:pickerFrame]; [pickerView addTarget:self action:@selector(pickerChanged:) forControlEvents:UIControlEventValueChanged];
This code works fine, but I'll want to handle exception if any thing goes
Im using c# .net windows form application. I have created a database which has
The code: // That works pretty well curl -d user%5Blogin%5D=some%40email.pl&user%5Bpass%5D=testpass&user%5Bmemory%5D=on&user%5Bsubmit%5D=Login -L -c cookie.txt http://turbobit.net/user/login
This code works fine in Chrome. However, in Firefox, when it hits the GMxhr
This code works for me except it only checks for a duplicate once, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.