Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4004430
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:16:21+00:00 2026-05-20T08:16:21+00:00

I have an ASPNET MVC application that works fine locally but when I deployed

  • 0

I have an ASPNET MVC application that works fine locally but when I deployed it to production I get the following stack trace.

There are a few puzzling things about this stack trace, for one everything worked fine before i deployed my changes, for two the location of the code is wrong it’s now on a production server not my dev machine and for three Rework is a controller method, not an object

2/28/2011 11:03:47 PM COB_Database.Controllers.ClaimsController Rework Object reference
not set to an instance of an object.    at COB_Database.ViewModels.ErrorVM.
<>c__DisplayClass12.<.ctor>b__1(Error err) in 
C:\Users\jperrine251\documents\visual studio 2010\Projects\COB Database\COB 
Database\ViewModels\ErrorVM.cs:line 26     at 
System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()     at 
System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)     at 
System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)     at 
COB_Database.ViewModels.ErrorVM..ctor(User user, Claim claim, IEnumerable`1 actions, 
IEnumerable`1 users, IEnumerable`1 referralReasons, Boolean editing) in 
C:\Users\jperrine251\documents\visual studio 2010\Projects\COB Database\COB 
Database\ViewModels\ErrorVM.cs:line 26     at 
COB_Database.Controllers.ClaimsController.Rework(Int32 id) in 
C:\Users\jperrine251\documents\visual studio 2010\Projects\COB Database\COB 
Database\Controllers\ClaimsController.cs:line 160     at lambda_method(Closure , 
ControllerBase , Object[] )     at 
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] 
parameters)     at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext 
controllerContext, IDictionary`2 parameters)     at 
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext 
controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)     at 
System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.
<InvokeActionMethodWithFilters>b__12()     at 
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, 
ActionExecutingContext preContext, Func`1 continuation)     at 
System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClass15.<>c__DisplayClass17.
<InvokeActionMethodWithFilters>b__14()     at 
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext 
controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 
parameters)     at 
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext 
controllerContext, String actionName) 

Anyone have any ideas?

EDIT: The line in question in the stack trace is this

UsersErrors = claim.Errors.Where(err => err.UserID == user.id && err.ErrorActionID != null &&
    err.ErrorActionLogs.OrderByDescending(eal => eal.id).FirstOrDefault().Timestamp >= DateTime.Now.AddHours(-10)).ToList();

And UsersErrors is defined as List<Error> UsersErrors

I tried changing the code to this but still no luck:

var userErrors = claim.Errors.Where(err => err.UserID == user.id && err.ErrorActionID != null &&
    err.ErrorActionLogs.OrderByDescending(eal => eal.id).FirstOrDefault().Timestamp >= DateTime.Now.AddHours(-10));
UsersErrors = userErrors == null ? new List<Error>() : userErrors.ToList();

Edit, I’ve isolated the line causing the problem further, I took the above code and broke it down into predicates and passed those to my linq expression, the following is what is failing (but working locally)

Func<Error, bool> errorLogp = 
    (err) => 
        err.ErrorActionLogs
           .OrderByDescending(eal => eal.id)
           .FirstOrDefault().Timestamp >= DateTime.Now.AddHours(-10);

Errors have a log of actions taken on them, this is just grabbing the most recent and ensuring it was done in the last 10 hours, I’ve checked the database for the record i’m testing on and it is present along with an error action log that meets the requirements

EDIT: Also to ensure that claim.Errors isn’t null I’ve done the following

UsersErrors = Claim.Errors == null ? 
    new List<Error>() : 
    Claim.Errors.Where(err => errorp(err) && errorLogp(err)).ToList();

but the code still bombs out at the errorLogp predicate Func

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T08:16:22+00:00Added an answer on May 20, 2026 at 8:16 am

    Are you jperrine251? If that’s not you, your code isn’t running on the server. From what I can tell it looks like your error handling code is making some assumptions that don’t hold in production and the whole thing is bombing out. Be very defensive in your error handling.

    Posting applicable code from ErrorVM and ClaimsController would be helpful too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net mvc application that works fine under visual studio but when
We have a file upload in our ASP.NET MVC application that works fine. It
I have an Asp.Net MVC application that works in the vs.net development web server.
We have an internal ASP.NET MVC application that requires a logon. Log on works
I have an ASP.net MVC 2 application that runs well locally. However when I
I have an ASP.NET MVC (using the release candidate) application that works with a
I have an asp.net mvc 2 application which works fine when run from visual
I have a ASP.NET MVC application that runs in both IIS 6 and 7.
We have an asp.net mvc application that we would like to integrate a FileSystemWatcher
I have an ASP.NET MVC application that has one part where I dont really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.