Server Error in '/' Application.

Value was either too large or too small for a UInt64.

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.OverflowException: Value was either too large or too small for a UInt64.

Source Error:


Line 40: 
Line 41:                     var x = "";
Line 42:                     if (Convert.ToUInt64(bytes) < 1048576)
Line 43:                     {
Line 44:                         x = ((Math.Round(Convert.ToDecimal(bytes) / 1024, 0)).ToString() + " Kb");

Source File: f:\Umbraco\Regeringen Prod\Regeringen.Web\1.0.0.277\Views\Partials\Archetype\DocumentBlock.cshtml    Line: 42

Stack Trace:


[OverflowException: Value was either too large or too small for a UInt64.]
   System.Convert.ToUInt64(Int32 value) +6769388
   ASP._Page_Views_Partials_Archetype_documentBlock_cshtml.Execute() in f:\Umbraco\Regeringen Prod\Regeringen.Web\1.0.0.277\Views\Partials\Archetype\DocumentBlock.cshtml:42
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +232
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +137
   Archetype.Extensions.HtmlHelperExtensions._renderPartial(HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, String partialPath, ViewDataDictionary viewDataDictionary) +479
   Archetype.Extensions.HtmlHelperExtensions._renderPartials(HtmlHelper htmlHelper, ArchetypeModel archetypeModel, String partialPath, ViewDataDictionary viewDataDictionary) +189
   ASP._Page_Views_Article_cshtml.Execute() in f:\Umbraco\Regeringen Prod\Regeringen.Web\1.0.0.277\Views\Article.cshtml:25
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +253
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +107
   Umbraco.Core.Profiling.ProfilingView.Render(ViewContext viewContext, TextWriter writer) +232
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +90
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +833
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +186
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +44
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1069.1