Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gordon Saxby 1347 posts 1608 karma points
    Jan 17, 2018 @ 16:24
    Gordon Saxby
    1

    Getting Value cannot be null error

    The first time refreshing a page, after rebuilding the Visual Studio project, I get the following error. However, a second refresh works fine and so does the site from then on ... until the next time I build the project. I think it also happens if IIS is restarted.

    Server Error in '/' Application.
    Value cannot be null.
    Parameter name: virtualPath
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.ArgumentNullException: Value cannot be null.
    Parameter name: virtualPath
    
    Source Error: 
    
    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
    
    Stack Trace: 
    
    
    [ArgumentNullException: Value cannot be null.
    Parameter name: virtualPath]
       System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +12170963
       System.Web.VirtualPathUtility.ToAbsolute(String virtualPath, String applicationPath) +53
       Umbraco.Core.IO.IOHelper.ResolveUrl(String virtualPath) +268
       InfoCaster.Umbraco.UrlTracker.Helpers.UmbracoHelper.IsReservedPathOrUrl(String url) +420
       InfoCaster.Umbraco.UrlTracker.Modules.UrlTrackerModule.UrlTrackerDo(String callingEventName, Boolean ignoreHttpStatusCode, HttpContext context) +1102
       InfoCaster.Umbraco.UrlTracker.Modules.UrlTrackerModule.Context_PostResolveRequestCache(Object sender, EventArgs e) +111
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +91
    
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2110.0
    

    I am also using Vorto, so have custom code for UrlProvider and ContentFinder. I have tried debugging but the error does not occur in my project code.

    Any ideas what might be causing this?

  • Daniel Chenery 119 posts 465 karma points
    Jan 17, 2018 @ 16:39
    Daniel Chenery
    101

    Hi Gordon,

    The line numbers in the stack trace are way off from the actual code. Interesting!

    Empty entries are actually 'removed' from the list, so this is a long shot, but... In your Web.config, are there any spaces after the comma in umbracoReservedUrls or umbracoReservedPaths?

  • Gordon Saxby 1347 posts 1608 karma points
    Jan 17, 2018 @ 16:48
    Gordon Saxby
    0

    Well done Daniel ... spot on, full marks, top of the class!! :-)

    The last entry in the umbracoReservedUrls list had a space after the preceding comma.

    That certainly seems to have fixed it ... but I think it would be a nice fix if spaces could be handled.

  • Daniel Chenery 119 posts 465 karma points
    Jan 17, 2018 @ 17:03
    Daniel Chenery
    0

    I'l add an issue to GitHub for the next release :)

  • Daniel Chenery 119 posts 465 karma points
    Jan 29, 2018 @ 15:19
    Daniel Chenery
    1

    Hi Gordon,

    This is fixed in 3.15!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies