2

Here is a quick question, when you use start up task, you need to put the cmd line in bin folder.

So if I don't want to put them in bin folder If I want to put it in solution folder what should I do.

1 Answer 1

2

The execution path of the Start-Up Tasks is not configurable and properly set in some precompiled enviroment dlls. It is set to "approot\bin" for Web roles, and "approot" for Worker roles.

I don't know whether it is good practice or not and rather would not recommend it, but i also had done some research on it and found out, that you can define the Startup Task with relative folder path:

<Task commandLine="../init-bla.cmd" executionContext="elevated" taskType="background" />

This will run the init-bla.cmd from approot. But be aware: The context of the cmd stays in the bin folder.

For example, if you want to output something to a file or call another file, you have to be aware of the execution context. This example-code creates the output.txt file into bin folder, although it runs from approot.

@echo off
ECHO I_WAS_CALLED_ON_STARTUP >> output.txt

EXIT /B 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.