Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC The resource cannot be found
    primarykey
    data
    text
    <p>Okay, this is driving me crazy.</p> <p>I have this project, and I am MONTHS without touching the <code>FeedController</code>. Everything was working fine. Then, I opened the <code>FeedController</code> to change some code inside an action and for some reason, VS2010 crashed. Okay, VS already crashed before, nothing unusual.</p> <p>So I restarted VS, and mysteriously, the <code>FeedController</code> started to give <em>"404 The resource cannot be found"</em> error.</p> <p>So I checked <code>Global.asax</code>, <code>Web.Config</code>, StartURL, all stuff people recommend. Can't get it to work. If I call <code>/Feed/Index</code>, It Works! But <code>/Feed/</code> just gives me the error.</p> <p>Changed the name of the entire controller to <code>ShitController</code> and It just WORKS PERFECT! Somehow, the project decided that "Feed" is some kind of "curse word".</p> <p>Cleaned solution, <code>/bin/</code> restarted vs dev server, restarted computer and it is just broker forever.</p> <p>I'm starting to think this is a MVC3 serious BUG.</p> <p>Anyone? </p> <p>I'm getting crazy. I should go for a walk, maybe :)</p> <p>Routes:</p> <pre><code>routes.MapRoute( "XBLContentDetailsLocale", "XBLContent/Details/{guid}/{locale}", new { controller = "XBLContent", action = "Details"}, new { guid = @"[0-9|a-z|\-]{36}", locale = @"[a-z|A-Z]{2}-[A-Z|a-z]{2}"} ); routes.MapRoute( "XBLContentDetails", "XBLContent/Details/{guid}", new { controller = "XBLContent", action = "Details" }, new { guid = @"[0-9|a-z|\-]{36}" } ); routes.MapRoute( "XBLContentDaysLocale", "XBLContent/{days}/{locale}", new { controller = "XBLContent", action = "Index" }, new { days = @"[0-9]", locale = @"[a-z|A-Z]{2}-[A-Z|a-z]{2}" } ); routes.MapRoute( "XBLContentDays", "XBLContent/{days}", new { controller = "XBLContent", action = "Index" }, new { days = @"[0-9]" } ); routes.MapRoute( "FeedRouteFull", "Feed/{action}/{sort}/{locale}", new { controller = "Feed", action = "GameAddons" }, new { sort = @"[a-z|A-Z]+", locale = @"[a-z|A-Z]{2}-[A-Z|a-z]{2}" } ); routes.MapRoute( "FeedRouteSort", "Feed/{action}/{sort}", new { controller = "Feed", action = "GameAddons", sort = UrlParameter.Optional }, new { sort = @"[a-z|A-Z]+" } ); routes.MapRoute( "FeedRoute", "Feed/{action}", new { controller = "Feed", action = "Index" } ); routes.MapRoute( "Locale", "{locale}", new { controller = "Home", action = "Index" }, new { locale = @"[a-z|A-Z]{2}-[A-Z|a-z]{2}" } ); routes.MapRoute( "ControllerLocale", "{controller}/{locale}", new { controller = "Home", action = "Index", locale = UrlParameter.Optional }, new { locale = @"[a-z|A-Z]{2}-[A-Z|a-z]{2}" } ); routes.MapRoute( "ControllerActionLocale", "{controller}/{action}/{locale}", new { controller = "Home", action = "Index", locale = UrlParameter.Optional }, new { locale = @"[a-z|A-Z]{2}-[A-Z|a-z]{2}" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); </code></pre> <p><strong>UPDATE:</strong> I commented all the routes leaving only the default one, and the error still exists.</p> <p><strong>UPDATE:</strong> Here is the whole controller. Only changed the Arcade action and commented the "oldcode":</p> <pre><code>public class FeedController : Controller { XBLContentContext db = new XBLContentContext(); private int activemenu = 4; private const int QT_FEED = 12; public ActionResult Index(string locale) { if (String.IsNullOrEmpty(locale)) locale = "en-us"; ViewBag.Title = "Xbox LIVE Feeds"; ViewBag.Description = "Xbox LIVE Feed generator. Configure and add it to your favourite feed reader."; ViewBag.Keywords = "xbox, live, tools, feed, syndication, rss, atom"; ViewBag.ContentType = Enum.GetValues(typeof(ContentType)).Cast&lt;ContentType&gt;().Select(v =&gt; new SelectListItem { Selected = (v == ContentType.Arcade), Text = v.ToString().ToSentence(), Value = v.ToString() }); ViewBag.SortBy = Enum.GetValues(typeof(SortBy)).Cast&lt;SortBy&gt;().Select(v =&gt; new SelectListItem { Selected = (v == SortBy.OfferStartDate), Text = v.ToString().ToSentence(), Value = v.ToString() }); ViewBag.Regions = (from x in GlobalVariables.Regions select new SelectListItem { Selected = (x.ID.ToLower() == locale), Text = x.Country, Value = x.ID.ToLower() }).OrderBy(x =&gt; x.Text).ToList(); return View(); } public ActionResult AllDownloads(string sort, string locale) { var today = DateTime.Today; var region = "All Regions"; var qry = from c in db.XBLRegionalContents.Include("Region").Include("Content") where c.PublishDate &lt;= today select c; var qry2 = from c in qry group c by c.ContentId into grouped let maxdate = grouped.Max(x =&gt; x.PublishDate) select new { Key = grouped.Where(x =&gt; x.ContentId == grouped.Key &amp;&amp; (x.PublishDate == maxdate)).FirstOrDefault(), Value = grouped.Where(x =&gt; x.ContentId == grouped.Key).Select(x =&gt; x.Region) }; if (!String.IsNullOrEmpty(locale)) qry2 = from c in qry2 where c.Value.Any(x =&gt; x.ID == locale) select c; var model = qry2.OrderByDescending(x =&gt; x.Key.PublishDate).Take(QT_FEED).ToDictionary(x =&gt; x.Key, x =&gt; x.Value); if (!String.IsNullOrEmpty(locale) &amp;&amp; model.Count() &gt; 0) region = model.FirstOrDefault().Key.Region.CountryEnglish; ViewBag.Language = locale; ViewBag.FeedTitle = "XBLTOOLS - Latest Content"; ViewBag.FeedDescription = String.Format("{0} - {1}", region, DateTime.Now); return View("GlobalFeed", model); } public ActionResult FullGames(string sort, string locale) { var today = DateTime.Today; var region = "All Regions"; var indie = ContentType.IndieGames.ToString(); var qry = from c in db.XBLRegionalContents.Include("Region").Include("Content") where c.Content.RelatedGameId == null &amp;&amp; c.Content.FileSize &gt; 0 &amp;&amp; c.PublishDate &lt;= DateTime.Today &amp;&amp; c.Content.ContentType != indie select c; var qry2 = from c in qry group c by c.ContentId into grouped select new { Key = grouped.Where(x =&gt; x.ContentId == grouped.Key).FirstOrDefault(), Value = grouped.Where(x =&gt; x.ContentId == grouped.Key).Select(x =&gt; x.Region) }; if (!String.IsNullOrEmpty(locale)) qry2 = from c in qry2 where c.Value.Any(x =&gt; x.ID == locale) select c; var model = qry2.OrderByDescending(x =&gt; x.Key.PublishDate).Take(QT_FEED).ToDictionary(x =&gt; x.Key, x =&gt; x.Value); if (!String.IsNullOrEmpty(locale) &amp;&amp; model.Count &gt; 0) region = model.FirstOrDefault().Key.Region.CountryEnglish; ViewBag.Language = locale; ViewBag.FeedTitle = "XBLTOOLS - Full Games"; ViewBag.FeedDescription = String.Format("{0} - {1}", region, DateTime.Now); return View("GlobalFeed", model); } public ActionResult Arcade(string sort, string locale) { var page = db.XBLPages.First(x =&gt; x.Type == (int)XBLPageType.List); using (XBLPageCrawler crawler = new XBLPageCrawler(page, ContentType.Arcade, DownloadType.Game, sort, locale)) { var countrycode = String.IsNullOrEmpty(locale) ? String.Empty : String.Format("{0} - ", locale.Split('-')[1].ToUpper()); ViewBag.Language = locale; ViewBag.FeedTitle = String.Format("{0}{1}", countrycode, crawler.CType.GetDescription()); return View("Feed", crawler.PageContent); } #region OLDCODE // using (XBLChart p = new XBLChart(ContentType.Arcade, DownloadType.Game, sort, locale)) // { // var countrycode = String.IsNullOrEmpty(locale) ? String.Empty : String.Format("{0} - ", locale.Split('-')[1].ToUpper()); // ViewBag.Language = locale; // ViewBag.FeedTitle = String.Format("{0}{1}", countrycode, p.CType.GetDescription()); // return View("Feed", p.ListaRegional); // } #endregion } public ActionResult GamesOnDemand(string sort, string locale) { using (XBLChart p = new XBLChart(ContentType.GamesOnDemand, DownloadType.Game, sort, locale)) { var countrycode = String.IsNullOrEmpty(locale) ? String.Empty : String.Format("{0} - ", locale.Split('-')[1].ToUpper()); ViewBag.Language = locale; ViewBag.FeedTitle = String.Format("{0}{1}", countrycode, p.CType.GetDescription()); return View("Feed", p.ListaRegional); } } public ActionResult IndieGames(string sort, string locale) { using (XBLChart p = new XBLChart(ContentType.IndieGames, DownloadType.Game, sort, locale)) { var countrycode = String.IsNullOrEmpty(locale) ? String.Empty : String.Format("{0} - ", locale.Split('-')[1].ToUpper()); ViewBag.Language = locale; ViewBag.FeedTitle = String.Format("{0}{1}", countrycode, p.CType.GetDescription()); return View("Feed", p.ListaRegional); } } public ActionResult GameDemos(string sort, string locale) { using (XBLChart p = new XBLChart(ContentType.GameDemos, DownloadType.GameDemo, sort, locale)) { var countrycode = String.IsNullOrEmpty(locale) ? String.Empty : String.Format("{0} - ", locale.Split('-')[1].ToUpper()); ViewBag.Language = locale; ViewBag.FeedTitle = String.Format("{0}{1}", countrycode, p.CType.GetDescription()); return View("Feed", p.ListaRegional); } } public ActionResult GameAddons(string sort, string locale) { using (XBLChart p = new XBLChart(ContentType.GameAddons, DownloadType.GameAddon, sort, locale)) { var countrycode = String.IsNullOrEmpty(locale) ? String.Empty : String.Format("{0} - ", locale.Split('-')[1].ToUpper()); ViewBag.Language = locale; ViewBag.FeedTitle = String.Format("{0}{1}", countrycode, p.CType.GetDescription()); return View("Feed", p.ListaRegional); } } public ActionResult GameVideos(string sort, string locale) { using (XBLChart p = new XBLChart(ContentType.GameVideos, DownloadType.GameVideo, sort, locale)) { var countrycode = String.IsNullOrEmpty(locale) ? String.Empty : String.Format("{0} - ", locale.Split('-')[1].ToUpper()); ViewBag.Language = locale; ViewBag.FeedTitle = String.Format("{0}{1}", countrycode, p.CType.GetDescription()); return View("Feed", p.ListaRegional); } } public ActionResult ThemesAndGamerPic(string sort, string locale) { using (XBLChart p = new XBLChart(ContentType.ThemesAndGamerPic, DownloadType.ThemesAndGamerPic, sort, locale)) { var countrycode = String.IsNullOrEmpty(locale) ? String.Empty : String.Format("{0} - ", locale.Split('-')[1].ToUpper()); ViewBag.Language = locale; ViewBag.FeedTitle = String.Format("{0}{1}", countrycode, p.CType.GetDescription()); return View("Feed", p.ListaRegional); } } protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); } } </code></pre> <p><strong>UPDATE</strong> Changed the Index action to Config and it works. Seems like the problem is with the default implicit "Index", because explicit /Feed/Index works too.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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