I am trying to develop my first SharePoint App. I have a Development Environment on Azure and Visual Studio 2013.
Then i create my app project by using the default Visual Studio 2013 (it's the same on Visual Studio 2012 i think) SharePoint App Template by going to
Click File -> New -> Project and choose App for SharePoint 2013
Then i choose Autohosted and select the sharepoint site i want to use for debug. Everything works fine.
Since this templates are supposed to run out of box, i press f5 for deubug. At first all seems well. Connection to Sharepoint is correctly made and i am presented with the following screen:
I press "Trust It" Option and i get the following screen:
I should be getting something like
I don't get this. If i have so much problems debugging the default sharepoint app imagine when i have to get to serious development... I am starting to get nervous about using SharePoint Apps. Does anyone is successfully eveloping apps?
EDIT:
After making some debug i found out the following:
On SharePointContextFilterAttribute.cs it always falls on:
RedirectionStatus.CanNotRedirect:
filterContext.Result = new ViewResult { ViewName = "Error" };
break;
If i drilled down a bit and i found out that before this, when it doesn't find a SharePoint Context it tries to create one and it fails here:
string spAppWebUrlString = TokenHelper.EnsureTrailingSlash(httpRequest.QueryString[SharePointContext.SPAppWebUrlKey]);
There is no key for SPAppWebURL on httpRequest... Don't now why or even if this is supposed to.
Then, after this fails, it falls on SharePointContext.cs CheckRedirectStatus() method:
if (StringComparer.OrdinalIgnoreCase.Equals(httpContext.Request.HttpMethod, "POST"))
{
return RedirectionStatus.CanNotRedirect;
}
It's really easy to replicate and test this. Just create a Developer Site and create a new SharePoint App Project (MVC or WebPages it doesn't matter since you are not changing any code).
After that just press f5 and test it against our SharePoint developer site. It is allegedly really easy to start...