Note that there are some explanatory texts on larger screens.

plurals
  1. POController not working after publish to azure website
    text
    copied!<p>I have created a simple web site using ASP.Net MVC 4, Internet Application. I added a controller, model and associated views for a new page. Everything works fine running locally, I can register, login and use my new page functionality. After publishing to Azure website I can successfully use the home, about, register, login all of the built in functionality. However I cannot navigate to my new content I added, it gives an error 500. Again all of this functionality does work locally. I am very new to ASP.Net MVC and could use any help I can get.</p> <p>RouteConfig</p> <pre><code>routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); </code></pre> <p>Index action of my added controller</p> <pre><code>private UsersContext uc = new UsersContext(); private UserProfile user = new UserProfile(); private Character character = new Character(); // // GET: /Character/ public ActionResult Index() { user = uc.UserProfiles.Single(u =&gt; u.UserName == User.Identity.Name); return View(uc.Characters.ToList().Where(c =&gt; c.AccountOwnerId == user.UserId)); } </code></pre> <p>Let me know if any other items would help. Oh I put this into my UsersContext instead of in a newly created DbContext.</p> <pre><code>public UsersContext() : base("DefaultConnection") { } public DbSet&lt;UserProfile&gt; UserProfiles { get; set; } public DbSet&lt;Character&gt; Characters { get; set; } </code></pre> <p>EDIT: one thing i forgot to mention is that when i published, it did not add the email address field to userprofile or my entire Character table. I had to run SQL on the Azure manage portal to manually add those items.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload