2

I have a Classic ASP website hosted on Azure (migrated now, rewrite later) and found there is a dependency on AspEmail.

To register on a normal IIS box the command is:

regsvr32 c:\AspEmailDir\AspEmail.dll

The SO answer here shows how to do this with a webrole but I have a website.

I was thinking a WebJob might work, or is there some other way?

Community
  • 1
  • 1
Stephen Price
  • 1,629
  • 1
  • 24
  • 42

1 Answers1

1

I don't think you will be able to do this on Azure website. I see two solutions here:

  1. Move to web role. Then you can execute this via startup task.
  2. Get rid of AspEmail or move it to a separate worker role.
SoftwareFactor
  • 8,430
  • 3
  • 30
  • 34
  • Trying to add to webrole in same solution but can't seem to find the right place to put the cmd file so that it outputs it to bin folder. There is no changing the build action if I put it inside the WebRole folder. Can't move it to same level as the ServiceDefinition (can't seem to add anything like a normal project). Also tried Webjob which almost worked, except its not elevated. – Stephen Price May 20 '14 at 09:47
  • For option 2, will a worker role deployed to the same website work? It should count as the same vm and the dll will be registered right? – Stephen Price May 20 '14 at 09:58
  • It seems you are adding the cmd file to cloud service definition project. But it should be in the same project as RoleEntryPoint. As regards, deploying to same VM as website, I am not sure if it will work. Alternatively, you can just remove AspEmail from your project and use something like SendGrid. Less worry, more reliable and does not cost a lot. – SoftwareFactor May 20 '14 at 12:05
  • Created Web Role, put the cmd file in the right place this time. Found that the Network Service account did not have write permission to the folders it needed (for logging). Added icacls command to that cmd file but currently doesn't seem to be running. no permissions and no aspemail still. Troubleshooting it at the moment. Thanks for the help so far! – Stephen Price May 21 '14 at 08:45
  • RDP to the web role and can see folder called approot which has the correct permissions on the folder as per my cmd (piped output to a file there). There is a sitesroot/0 folder with copy (assuming the instance 0 of webrole) and the permissions are wrong there. I guess the folder is copied before the startup cmd is executed. – Stephen Price May 21 '14 at 08:51
  • You can stop looking now. As work around I applied the permissions to both folders, and realised I needed the 64bit version of the AspEmail, so thanks got it all working now. :) – Stephen Price May 21 '14 at 09:24