I had a code written for a web application that used OLEDB adapter to query a set of rows from an excel sheet. In an on-premise deployment, I could very easily change an application pool setting found in the advance settings. Something like this
If you were to do this for a web role , you'd have to do this in a different way.
Solution is to add a startup task in a web role. Not that you cannot logon using a remote desktop to your webrole and change it in the same way described above, but the solution is not persistent(does not span through recycling of an instance).
A neat solution is to add a startup task :
1.) Add this xml as the last child of WebRole element in the ServiceDefinition.csdef
<Task commandLine="ConfigureIIS.cmd" executionContext="elevated" taskType="simple" />
2.) Next part is to create the "ConfigureIIS.cmd" file in the web project and in the properties window , change copy to output directory to "Copy Always"
Content of file should be :
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.enable32BitAppOnWin64:true
Note : Open a notepad and then insert this file in the web application. Do not create it in Visual studio directly. I've observed that VS adds some junk character in the beginning of the file. so avoid it