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.317\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) +6292028
   ASP._Page_Views_Partials_Archetype_documentBlock_cshtml.Execute() in f:\Umbraco\Regeringen Prod\Regeringen.Web\1.0.0.317\Views\Partials\Archetype\DocumentBlock.cshtml:42
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   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) +238
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +136
   Archetype.Extensions.HtmlHelperExtensions._renderPartial(HtmlHelper htmlHelper, ArchetypeFieldsetModel fieldsetModel, String partialPath, ViewDataDictionary viewDataDictionary) +486
   Archetype.Extensions.HtmlHelperExtensions._renderPartials(HtmlHelper htmlHelper, ArchetypeModel archetypeModel, String partialPath, ViewDataDictionary viewDataDictionary) +188
   ASP._Page_Views_Article_cshtml.Execute() in f:\Umbraco\Regeringen Prod\Regeringen.Web\1.0.0.317\Views\Article.cshtml:25
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   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) +238
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +375
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +88
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +831
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +831
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +831
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +185
   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) +67
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   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) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +67
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +607
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134


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