Tuesday 17 November 2015

Enable 32 bit Applications Azure Cloud Service Hosting automation

Enable 32 bit Applications Azure Cloud Service Hosting automation

Sometime dll issues occured on IIS based on 32-bit or 64-bit dlls.Error occured like below

Could not load file or assembly 'Microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader' or one of its dependencies. An attempt was made to load a program with an incorrect format.
If you have already reference with microsoft.TeamFoundation.WorkItemTracking.Client.DataStoreLoader.dll or respective dll and its dependencies. 

Then it may be error due to 32-bit applications disabled on IIS.



To resolve this error, you can set it manually from IIS.
If you need hosted a site again and again. It will be time consuming to enable it.
To automate this, create a startup script with the below given commands
%windir%\system32\inetsrv\appcmd set config -section:system.applicationHost/applicationPools

Save as this line to “setup.bat”.
Then include this file into your project, set "copy local"=true.
Open your ServiceDefinition.csdef and add below lines as in snapshot.
<webrole >
     <Startup>
              <Task commandLine="setup.cmd" executionContext="elevated" />
          </Startup>
</webrole >




















1 comment:

Please leave a comment for this post