Azure application working on emulator but not on azure cloud

Posted by Hisham Riaz on Stack Overflow See other posts from Stack Overflow or by Hisham Riaz
Published on 2011-01-11T05:48:05Z Indexed on 2011/01/11 5:53 UTC
Read the original article Hit count: 409

Filed under:
|

firstly i am developing my MVC3 application on visual web developer 2010 express, by migrating my MVC3 (cshtml) files on MVC2. it works great on local system using the emulator, but once i deploy the application on azure it gives runtime errors.

example:

The layout page "~/Views/Shared/test_page.cshtml" could not be found at the following path: "~/Views/Shared/test_page.cshtml".

Source Error:

Line 8: //Layout = "~/Views/Shared/upload.cshtml"; Line 9: //Layout = "~/Views/Shared/_Layout2.cshtml"; Line 10: Layout = "~/Views/Shared/test_page.cshtml"; Line 11: } Line 12: else

CODE IS AS FOLLOWS:

_ViewStart.cshtml file

@{

string AccId = Request.QueryString["AccId"].ToString();


if (AccId=="0")
{
    //Layout = "~/Views/Shared/upload.cshtml";
    //Layout = "~/Views/Shared/_Layout2.cshtml";
    Layout = "~/Views/Shared/test_page.cshtml";
}
else
{
    string LayOutPagePath = MVCTest.Models.ComponentClass.GetLayOutPagePath(AccId);
    Layout = LayOutPagePath; 
}

}

.........

how ever the page exist, and is working fine on azure emulator, but not in azure cloud.

CODE FOR test_page.cshtml

@{

var result = "1234567890";
var temp_xml = MVCTest.Models.ComponentClass.GetTemplateAndTheme("1");//returning xml
string LayOutPagePath = MVCTest.Models.ComponentClass.GetLayOutPagePath("1");//returning string

}

@RenderBody()

test_page

@temp_xml @result @LayOutPagePath

© Stack Overflow or respective owner

Related posts about Azure

Related posts about emulator