locked
System.Web.Security.CookielessHelperClass NullReferenceException Error RRS feed

  • Question

  • I have an ASP.NET MVC 4.7.1 project and it's been working fine for months but now I'm getting this error whenever I try to debug it on my local machine using IIS Express on Windows 10:

    [NullReferenceException: Object reference not set to an instance of an object.]
       System.Web.Security.CookielessHelperClass.UseCookieless(HttpContext context, Boolean doRedirect, HttpCookieMode cookieMode) +9828485
       System.Web.Security.FormsAuthenticationModule.ExtractTicketFromCookie(HttpContext context, String name, Boolean& cookielessTicket) +1995
       System.Web.Security.FormsAuthenticationModule.OnAuthenticate(FormsAuthenticationEventArgs e) +110
       System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +84
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +144
       System.Web.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0() +26
       System.Web.StepInvoker.Invoke(Action executionStep) +107
       System.Web.<>c__DisplayClass4_0.<Invoke>b__0() +23
       Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule.OnExecuteRequestStep(HttpContextBase context, Action step) +64
       System.Web.<>c__DisplayClass284_0.<OnExecuteRequestStep>b__0(Action nextStepAction) +56
       System.Web.StepInvoker.Invoke(Action executionStep) +91
       System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +9972006
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +73

    The whole stack trace is .NET, not my code. The debugger in VS starts but no breakpoint or exception gets hit. 

    It runs fine on the test server and production server which is a good thing but debugging remotely to the test server sucks and very time consuming.

    All of my other ASP.NET projects are still working.

    I've tried repairing my installation of Visual Studio 2017 which didn't help.

    What's this 'CookielessHelperClass' class? I wasn't able to find much on it.

    Any ideas? Maybe it's coming from a Nuget package that I don't need?
    Friday, May 29, 2020 1:08 PM

Answers

  • Hi QCChrisJ,

    Thank you for posting here.

    According to your description, your issue is more related to ASP.NET. Therefore, it will be more appropriate to ask your question in ASP.NET forum.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Thank you for your understanding.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by QCChrisJ Monday, June 1, 2020 12:16 PM
    Monday, June 1, 2020 3:24 AM

All replies

  • I forgot to mention I tried copying the solution folder from my coworkers PC who can debug it and I wasn't able to and I tried real IIS 10.0. Same error. I'm pretty sure there's something wrong with my PC's configuration or installation of some .NET component.
    Friday, May 29, 2020 1:28 PM
  • Hi QCChrisJ,

    Thank you for posting here.

    According to your description, your issue is more related to ASP.NET. Therefore, it will be more appropriate to ask your question in ASP.NET forum.

    The CLR Forum discuss and ask questions about .NET Framework Base Classes (BCL) such as Collections, I/O, Regigistry, Globalization, Reflection. Also discuss all the other Microsoft libraries that are built on or extend the .NET Framework, including Managed Extensibility Framework (MEF), Charting Controls, CardSpace, Windows Identity Foundation (WIF), Point of Sale (POS), Transactions.

    Thank you for your understanding.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by QCChrisJ Monday, June 1, 2020 12:16 PM
    Monday, June 1, 2020 3:24 AM
  • Thanks for letting me know.

    For anyone who is having the same issue and got here from a search engine, you can see my new thread here:
    forums.asp.net/p/2167467/6306804.aspx

    • Edited by QCChrisJ Monday, June 1, 2020 12:26 PM added link
    Monday, June 1, 2020 12:16 PM