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

  • SEARCH
  • Home
  • 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 521551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:15:43+00:00 2026-05-13T08:15:43+00:00

I’ve built a program in C# Windows Forms, now on the first load up

  • 0

I’ve built a program in C# Windows Forms, now on the first load up it tries to create scheduled tasks. If it raises an exception and it’s in main computer then this is the first time the softwere loads (you can intall this program on many computers but one computer is the main with the scheduled tasks).

I’ve tried this program on many computers and it worked perfectly (XP-SP1/2, Vista-SP1/2, Win7), now when I try to install it on a limited user (on Win XP Pro SP2) it tries to create the scheduled tasks. I get an Argument Null Reference and when I enter the admin user, it installs the scheduled task on the admin user and won’t run if the limited user is logged in (which is 99.9% of the time) .Why do I get this exception? I’ve looked for hours on the code searching for the reason of this exception but I can’t find it!

Thanks a lot!

Amit

MainOrSec = true;

User and Pass are public variables whice return from FirstTimeUp.

private bool CreateNoExit()
        {
            try
            {
                RegistryKey key = Registry.CurrentUser;
                key = key.OpenSubKey("Crm");
                MainOrSec = Convert.ToBoolean(AESIMP.Decrypt((string)key.GetValue(AESIMP.Encrypt("MorS"))));
            }
            catch (ArgumentNullException)
            {
                MainOrSec = true;
            }
            if (MainOrSec)
            {
                ScheduledTasks sc = new ScheduledTasks();
                Task task;
                try
                {
                    task = sc.CreateTask("NoExit");
                    FirstTimeUp f = new FirstTimeUp(this);
                    f.ShowDialog();
                }
                catch (ArgumentException)
                {
                    return false;
                }
                if (!CreatT)
                    return false;
                task.ApplicationName = @"C:\Program Files\Triffon\Crm Setup
2.0.0002\noexit.exe";
                task.Comment = "Check For no exit on the database.";
                task.SetAccountInformation(User, Pass);
                task.IdleWaitMinutes = 10;
                task.Triggers.Add(new DailyTrigger(5, 0));
                try
                {
                    task.Save();
                    task.Close();
                    sc.Dispose();
                }
                catch (COMException ex)
                {
                    MessageBox.Show(ex.Message);
                    return false;
                }
                return true;
            }
            return false;
        }
  • 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-05-13T08:15:43+00:00Added an answer on May 13, 2026 at 8:15 am

    OK, so if you get an exception, the best thing to do is to run your program under Visual Studio’s debugger so you can see exactly where the exception is called. Here, Ctrl-Alt-E is your friend: turn on the checkbox in the “Thrown” column next to “Common Language Runtime Exceptions” and you’ll break to the debugger no matter what.

    If you are testing your application on a user’s computer without Visual Studio then you have some other options. One (if you’re using Pro and above) is to run the Remote Debugger on the remote PC. Then you can attach to the running program and see the exception.

    If you don’t have Pro, or can’t easily use the remote debugger, then it is definitely worth using a decent logging framework like log4net to make sure that all exceptions are caught, trapped, and written to a log file. Frankly no production application should be released until this is done.

    When you’ve done this, take a careful look at the exception trace to see where the problem is caused. I’d be willing to bet that that ScheduledTasks class is throwing an exception somewhere that you’re not expecting.

    Finally, you’ll be getting downvotes because the culture here is “we’ll help if you let us know everything we need to know to help.” There’s been a couple of requests in the comments for the full stack trace, which hasn’t appeared, so people here will consider that rude, I’m afraid.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.