0

I'm doing a experiment on purpose of making a executable program work on windows azure.

First i tried to make it work using remote desktop with windows azure roles(ref http://msdn.microsoft.com/en-us/library/windowsazure/gg443832.aspx), I copied my exe into the remote desktop, and also some dlls, then I use "regsvr32.exe" to register these dlls, then the problem came: "side by side configuration is incoreect".

I know how to resolve this problem when it is in my own computer(just make sure the right dependencies are in the "winsxs" directory ), but now it's in the remote desktop using windows azure roles, and I have no permission to add the right dependencies into the winsxs directory. so here I came to ask for some help, thanks in advance!

PS: I can't change these dlls referenced by my exe.

Jack
  • 3
  • 1
  • Just wanted to make sure you're aware that Windows Azure uses stateless VM's. As such, any changes to make by remote desktop in the applicatin will be lost if that VM is recycled for any reason. This includes when the Windows Azure Fabri Controller applies any guest OS updates. Given this, attempting to port a desktop app to WA wouldn't be my first choice. – BrentDaCodeMonkey May 18 '12 at 13:52
  • Agree with you, I will try to use a work role to do these things just like the first answer below. But before that, I'm trying to realize a prototype through the VM, I have to make sure that my executable file can be running on the Azure VM without modifying it(also to make sure all those dependency dlls registered successfully), then the things remained will be simple(to create a worker role like the first answer below) – Jack May 23 '12 at 01:51

1 Answers1

0

I would say that the problem could be only because a few of the reference DLL are not in the Azure VM so when you deploy your package (EXE + DLL) you need to be sure you all the components and they are registered in the system. It sure is good that you can log into Azure VM using RDP and test how your deployment works however the best would be to deploy your package through a web/worker and in your can a worker role seems good fit.

You still need to dig further to find out why EXE did not work and if you provide more details about the libraries and process, we may help but above info is very less to provide suggestions.

To solve such problem here is what you should do:

  1. Create a zip file and include all the reference DLL/ EXE, static file needed for your application
  2. Create a Worker role and add this zip file as content and set its property Copy local to true.
  3. Add a CMD Batch file to your Azure Project and write all the steps as below:

    3.1. Unzip the files to a local folder 3.2. Register all the DLL using Regsvr32 process 3.3. Setup your exe as ProgramEntryPoint into ServiceDefinition.csdef

Using your EXE as ProgramEntryPoint, worker role host process will start it and monitor it, the setting looks like as below:

<Runtime executionContext="limited">
 <EntryPoint>
   <ProgramEntryPoint commandLine="your_exe_name.exe" setReadyOnProcessStart="true" />
 </EntryPoint>
</Runtime>

Once you have above settings, you can deploy the Azure Package and then RDP to Azure VM and test if your application has any problem.

AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65
  • Thanks for your answer, but before realizing a worker role, I'm having a try on the VM to find out whether my old executable can be run without changing it. So first I copy the EXE and DLLs into the VM, and try to use "regsvr32" to register these DLLs, then I find out that some of the DLLs cannot be registered because of the side by side configuration issue. I use the "dependency walker"(http://www.dependencywalker.com/) to see the dependencies of my DLL, then I find out that the DLL relied on the MSVCR80.DLL in the "C:\windows\winsxs" dir, which can not be found in the Azure VM. – Jack May 23 '12 at 02:06
  • and I also tried to to copy that MSVCR80.DLL into the directory where my DLL laid, but it seems that "regsvr32" refused to use this one. – Jack May 23 '12 at 02:09
  • You need to download (http://www.microsoft.com/en-us/download/details.aspx?id=5555) install the C++ runtime instead of using copy the MSVCR80.DLL, copy will not work. – AvkashChauhan May 23 '12 at 21:14
  • When you decided to use Worker role you also need to download VC++ runtime in startup task first. – AvkashChauhan May 23 '12 at 21:15