locked
Application Pool Framework 4.0 by Default on Azure RRS feed

  • Question

  • Here is my problem...

    Each time I upload my website on Azure, the application pool is set by default to framework 2.0, which ain't work with my site, so I have to change it. Is there anyway to have this automatic generated application pool to framework 4.0 by default ?

    Thanks.

    Tuesday, May 29, 2012 6:56 PM

Answers

All replies

  • Hi,

    I've tested this problem at my side, i find if i create a web application (Target Framework is 4.0) and publish it by "Publish" button in VS, and connect to Azure VM instance via Remote desktop, the default Application pool version is V4.0. Would you like to check your application target Framework version in web.config file (Perhaps 3.5 at your side)?

    <system.web>
        <compilation debug="true" targetFramework="4.0" />
    </system.web>

    If you find everything is OK, but still get the same issue, i suggest you create a startup task for changing the Azure application pool manually to see if works, you can use appcmd.exe for archieving goal, for example:

    appcmd set apppool /apppool.name:Marketing /managedRuntimeVersion:v1.1

    Or use code to do this, more details please refer to following documentation and thread:

    http://technet.microsoft.com/en-us/library/cc754523(v=WS.10).aspx

    http://forums.iis.net/t/1152659.aspx

    Hope this helps.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework


    • Edited by Arwind - MSFT Wednesday, May 30, 2012 5:36 AM
    • Marked as answer by Mhyrtas Thursday, May 31, 2012 12:54 PM
    Wednesday, May 30, 2012 5:35 AM
  • Thanks for the answer.

    I've checked in my web.config and everything seems okay. But the difference is that I publish the website automatically with a Powershell script. I need to keep it like this.

    In fact, I need everything to work as soon as the website is on Azure without any fix from me. Wll the appcmd help me to fix this ?

    Wednesday, May 30, 2012 3:22 PM
  • Yes, I think so, please refer the link i posted above, you can write script or code for change application pool version of IIS, and this script or function should be executed before application runs.

    Configure the script as the startup task of Azure:

    http://blogs.msdn.com/b/lucascan/archive/2011/09/30/using-a-windows-azure-startup-script-to-prevent-your-site-from-being-shutdown.aspx

    Hope this helps.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

    • Marked as answer by Mhyrtas Thursday, May 31, 2012 12:54 PM
    Thursday, May 31, 2012 2:15 AM
  • Thank you very much !

    I combined the exemples you gave me to finally come with this command line:

    %windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.managedRuntimeVersion:v4.0

    I tested it on my computer and it works, so I suppose it will on Azure now.

    EDIT: I can't even test it to Azure, because it won't let me build my package...

    It says: CloudServices64 : Cannot find file named 'approot\bin\startup.cmd' for startup task startup.cmd... I did some research and people say that we need to change 'Copy to outputdirectory' property in 'Copy always'. I can't even doing this; I don't build my project via Visual Studio.


    • Edited by Mhyrtas Thursday, May 31, 2012 2:06 PM New problem !
    Thursday, May 31, 2012 12:56 PM
  • I have the same issue.  Did you find an answer that worked?


    DB Architect

    Tuesday, June 12, 2012 3:22 AM