Sami
Sami

Reputation: 1404

Run executable from local storage using Azure Web Role

i'm trying to run a simple executable using an Azure Web Role.

This is the method I am using to run the executable:

    public void RunExecutable(string path)
    {
        Process.Start(path);
    }

Where path is localStorage.RootPath + "Application.exe"

The problem I am facing is that when I open the local storage folder the executable is there however there is no log.txt file.

I have tested the executable, it works if I manually run it, it produces the log.txt file.

Can anyone see the problem?

Upvotes: 0

Views: 708

Answers (2)

Robbin Cremers
Robbin Cremers

Reputation: 31

If you remote desktop into the instance, can't you find the file created at E:\approot\ folder ? As Steve said, using a WorkingDirectory for the process will fix the issue

You can use Environment.GetEnvironmentVariable("RoleRoot") to construct the URL to your application root

Upvotes: 1

user94559
user94559

Reputation: 60133

Try setting an explicit WorkingDirectory for the process... I wonder if log.txt is being created, just not where you expect. (Or perhaps the app is trying to create log.txt but failing because of the permissions on the directory it's trying to create it in.)

Upvotes: 1

Related Questions