none
VS 2013 preview - mvc app runs locally but not in Azure Websites

    Question

  • Anyone know how to solve problem deploying to Azure websites - Could not load file or assembly 'System.Web.Helpers' or one of its dependencies?


    Jim Mead

    Sunday, June 30, 2013 3:25 AM

Answers

  • I started over, selected asp.net web app, mvc, local identity, asp.net framework 4.5, and everything works, including deploying to azure websites,  therefore I think the problem was introduced by my starting with a 4.51 template and then changing the target framework to 4.5.


    Jim Mead

    • Marked as answer by Jim Mead Wednesday, July 03, 2013 11:31 AM
    Wednesday, July 03, 2013 11:31 AM

All replies

  • Hi,

    Please try the suggestions at http://blogs.msdn.com/b/asiatech/archive/2013/01/09/how-to-resolve-the-could-not-load-file-or-assembly-issues-on-windows-azure-web-sites.aspx to check if it resolves the issue.

    In addition, you can get more information on how to troubleshoot a Web Site at: http://www.windowsazure.com/en-us/develop/net/best-practices/troubleshooting-web-sites/

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, July 01, 2013 7:52 AM
    Moderator
  • I think both answers above are helpful.  The first trick is locating what web.helper dll to include.  The correct one for me in this instance is C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Stack 5\Packages\Microsoft.AspNet.WebPages.3.0.0-beta1\lib\net45\System.Web.Helpers.dll 

    It is NOT in the project references ( must be pulled in from some other dll usage ). 

    I will try deploying to Azure again with this reference included and marked copy local when I get back to a good network ( writing this on a cellular network ).

    Thanks,

    - Jim


    Jim Mead

    Tuesday, July 02, 2013 9:20 PM
  • Adding the webhelpers.dll reference fixed that issue, but just moved the same problem to EF 5,  and 23 dlls later from the ASP.NET Web Stack 5 directory, my error message has changed to:

    Compiler Error Message: CS0121: The call is ambiguous between the following methods or properties: 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserName(System.Security.Principal.IIdentity)' and 'Microsoft.AspNet.Identity.IdentityExtensions.GetUserName(System.Security.Principal.IIdentity)'

    Line 10:             @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Manage", "Account", routeValues: null, htmlAttributes: new { title = "Manage" })

    Source File: c:\DWASFiles\sites\testflurryapp\VirtualDirectory0\site\wwwroot\Views\Shared\_LoginPartial.cshtml               Line:  10            


    Starter app still runs OK locally, but fails with compiler error above if deployed to azure website.


    Jim Mead

    Wednesday, July 03, 2013 4:21 AM
  • I started over, selected asp.net web app, mvc, local identity, asp.net framework 4.5, and everything works, including deploying to azure websites,  therefore I think the problem was introduced by my starting with a 4.51 template and then changing the target framework to 4.5.


    Jim Mead

    • Marked as answer by Jim Mead Wednesday, July 03, 2013 11:31 AM
    Wednesday, July 03, 2013 11:31 AM