Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-22T11:13:48Z
I'm using "Run in hidden window" and credentials to run a .Net console program in VC 5.5.9

After a server reboot the Task will not start. The VC client just says "Succes".
I can fix the problem by un-checking "Run in hidden window", start the job, stop the job, check “"Run in hidden window”.

Is this a bug?

What is the link between "Run in hidden window" and “Execution context: background”?
Should I stop using "Run in hidden window"?


Sponsor
Forum information
Support
2010-11-22T21:22:31Z
It depends what your application do. Normally it is not a problem running in a hidden window - unless your application requires desktop access or require user interaction.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-22T21:38:06Z
The program is a console and does not need any GUI.

Please answer all my questions.

Is this a bug?

What is the link between "Run in hidden window" and “Execution context: background”?
Support
2010-11-22T21:51:01Z

Is this a bug?

No

What is the link between "Run in hidden window" and “Execution context: background”?

There is no link. However, in older versions of Windows - pre-Vista - it was "allowed" to run applications in non-hidden mode. As this affects security it was later replaced by a warning about application trying to run in interactive mode in the background.

In VisualCron, background mode refers to executing directly from the VisualCron service and foreground mode is executing from the Tray Client (which is always in desktop mode).
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-22T23:00:58Z
Thanks.

But how do you explain this and are you able to reproduce it?

After a server reboot the Task will not start. The VC client just says "Succes".
I can fix the problem by un-checking "Run in hidden window", start the job, stop the job, check “"Run in hidden window”.
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-22T23:02:31Z
There is no link. However, in older versions of Windows - pre-Vista - it was "allowed" to run applications in non-hidden mode. As this affects security it was later replaced by a warning about application trying to run in interactive mode in the background.

In VisualCron, background mode refers to executing directly from the VisualCron service and foreground mode is executing from the Tray Client (which is always in desktop mode).


So with Server 2008 I should use “Execution context: background” in stead of "Run in hidden window"?

Support
2010-11-23T08:42:52Z
vcdkk wrote:

There is no link. However, in older versions of Windows - pre-Vista - it was "allowed" to run applications in non-hidden mode. As this affects security it was later replaced by a warning about application trying to run in interactive mode in the background.

In VisualCron, background mode refers to executing directly from the VisualCron service and foreground mode is executing from the Tray Client (which is always in desktop mode).


So with Server 2008 I should use “Execution context: background” in stead of "Run in hidden window"?



"Run in hidden window" is independent of "Execution context". But we always recommend running in background AND hidden unless you really need to see your application interface.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-23T09:03:37Z
OK. Could you try this, and see if you can reproduce it?

I'm using "Run in hidden window" and credentials to run a .Net console program in VC 5.5.9

After a server reboot the Task will not start. The VC client just says "Succes".
I can fix the problem by un-checking "Run in hidden window", start the job, stop the job, check “"Run in hidden window”.
Support
2010-11-23T09:08:58Z
vcdkk wrote:

OK. Could you try this, and see if you can reproduce it?

I'm using "Run in hidden window" and credentials to run a .Net console program in VC 5.5.9

After a server reboot the Task will not start. The VC client just says "Succes".
I can fix the problem by un-checking "Run in hidden window", start the job, stop the job, check “"Run in hidden window”.



Please check the realtime log. This is abnormal behavior. I think the Task starts but maybe fails, finishes fast, or not started because of a Condition.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-23T09:52:32Z
Cannot find "realtime log" in the help, where is it?
Support
2010-11-23T13:24:56Z
Sorry, it is the normal log window in the Client.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-23T16:58:27Z
VisualCron log seems to say that everything is fine, but it isn't!

Job Started
User "Visual Default Admin" - Ran Job
Skipping Condition
Task started
Task completed
Job completed

Please try to reproduce it!

1. Create new job "Run in hidden window" and with credentials to run a .Net console program in VC 5.5.9 (I'm using the LoggingConsole.exe from my other bug report)
2. Restart the server.
3. Start the job. No log file is written. This is a bug! The program is never started!
4. Uncheck "Run in hidden window" and start the job. Log file is written.
5. Check "Run in hidden window" again and start the job. Log file is written.

Regards,

Stig

Support
2010-11-23T21:08:47Z
It is not related to "run hidden". When running with Credential working directory is handled a little bit different. As you have not specified a absolute path to your log file it is written to elsewhere. Try one of the following:

1. specify a working directory
2. use a absolute path instead of relative
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2010-11-23T21:17:27Z
We have changed this behavior in upcoming version so it use current directory if no other working directory is specified.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-23T21:30:59Z
I have checked the "working directory" so it has nothing to do with my problem.

Have you tried to reproduce it?


Support
2010-11-23T21:39:37Z
Yes, we tested with loggingconsole.exe. When not using working directory it did not write in the same folder. When using working directory it did write in the working directory folder.

You can easily change your code to write to a specific location and you will see that it works regardless of working directory and hidden mode.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-23T21:56:32Z
But something is broken and it has nothing to do with working directory!

How do you explain step 4 and 5 in my test? I'm not changing "working directory" but only the "Run in hidden window" and suddenly it works. If i restart the server, it will stop working againg until i uncheck and check the "Run in hidden window" option.

3. Start the job. No log file is written. This is a bug! The program is never started!
4. Uncheck "Run in hidden window" and start the job. Log file is written.
5. Check "Run in hidden window" again and start the job. Log file is written.
Support
2010-11-23T21:59:03Z
The problem might be your test sample file.

Your test file does the following:

1. write to file
2. sleeps forever

What happens, unless you uncheck "Don't start if Job is already running" is that the process is considered running - and your new Job won't run.

Another workaround is to kill the Task before trying again.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-23T22:17:08Z
- I'm not using "Don't start if Job is already running"
- The process is not running (it is not in the task manager)
- After a restart VC will not start the process!
- When i uncheck "Run in hidden window" it works as expected!

It smells very much like a bug - tomorrow I will test on another machine.

Did you remember to reboot the server?

Stig
Support
2010-11-23T22:51:28Z
Reboot does not affect behavior and we tested this. Make sure that you don't have any UAC settings on.

I recommend, to make the testing easier and less error prone on your side:

1. Remove the loop
2. add a simple one line Console write line. Then you will see in the output window if the Task was run or not even though the file was not created. Add this Console.WriteLine _above_ the file write
3. write to a specific location rather than current directory unless you specify a working directory. As I mentioned we have fixed that issue, so it writes to current directory if working directory is unchecked
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2010-11-23T23:04:50Z
You can download the latest version here:

http://www.visualcron.co....aspx?g=posts&t=1555 
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-24T11:07:08Z
I have now reproduced the situation on two servers. Also I have made the test setup less error pron. The console now writes to the Event Log instead of the file system.

Important! First run the ConsoleApplication1.exe as Administrator on the machine to create Event Log Source.

1. Create Job. Add Task. Check "Run in Hidden Window". Add user credentials from the domain. Task Type : Execute
2. Restart the server.
3. Start Job. Eventlog contains error message
4. Uncheck "Run in Hidden Window".
5. Start Job. Eventlog contains expected message.

Error message
Faulting application ConsoleApplication1.exe, version 1.0.0.0, time stamp 0x4cecda76, faulting module KERNEL32.dll, version 6.0.6001.18000, time stamp 0x4791a783, exception code 0xc0000142, fault offset 0x0006ecfb, process id 0xf90, application start time 0x01cb8bbe16fbdd94.
File Attachment(s):
ConsoleApplication1.exe (5kb) downloaded 52 time(s).
Support
2010-11-24T21:22:40Z
We could not reproduce this. Log entries where successfully created after each run.

Don't know why you changed the code to writing log entries instead of to file? If an application fails like this in VisualCron you should not see "Success" (which was the case in your previous test). Are you still seeing success? If you see that we are talking about a whole different test scenario and we wonder if writing to file was a success are simplifying the application?

If would guess, the problem is related to any of the following:

1. antivirus or other execution prevention software (not sure what is built in/installed on your server)

I don't know about your company policies but hopefully you have access to a clean install before pushing out other software and local security policies.

2. windows not updated. Especially .NET. Perhaps special hotfix applied?

3. the error is related the architecture or build. Maybe there is some special build parameters that is used?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-25T12:11:53Z
Don't know why you changed the code to writing log entries instead of to file?
No file rights and relative pathes to fight with

Are you still seeing success?
Yes

If you see that we are talking about a whole different test scenario and we wonder if writing to file was a success are simplifying the application?
Not sure what you mean?

2. windows not updated. Especially .NET. Perhaps special hotfix applied?
Latest .net 4.0 on all the machines

3. the error is related the architecture or build. Maybe there is some special build parameters that is used?
Plain out of the box .net console build.
vcdkk
  •  vcdkk
  • No customer Topic Starter
2010-11-25T12:16:59Z
I have now tested on 3 machines. It seemes to be an error releated to Server 2008 and/or wmware.

Windows Server 2008 SP1 (wmware) + VC 5.7.0
Failure. After a reboot there is an error in the Event Log (*) + VC says Succes
Unchecking the "Run in Hidden Window" makes it work!

Windows Server 2008 SP2 (wmware) + VC 5.5.9
Failure. After a reboot nothing is in the event log + VC says Succes
Unchecking the "Run in Hidden Window" makes it work!

Windows 7 + VC 5.5.3
Succes. Works fine after a reboot!

*)Faulting application ConsoleApplication1.exe, version 1.0.0.0, time stamp 0x4cecda76, faulting module KERNEL32.dll, version 6.0.6001.18000, time stamp 0x4791a783, exception code 0xc0000142, fault offset 0x0006ecfb, process id 0xf90, application start time 0x01cb8bbe16fbdd94.
Scroll to Top