Server Error in '/' Application.

Parameter is not valid.

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.ArgumentException: Parameter is not valid.

Source Error:


Line 24:             'fileName = Right(CType(Me.FormView1.FindControl("_HPercorso"), HiddenField).Value, LunghezzaFile)
Line 25:             fileName = System.Configuration.ConfigurationManager.AppSettings("pathWEBApp") & CType(Me.FormView2.FindControl("_HPercorso"), HiddenField).Value
Line 26:             objBMPFoto = New Drawing.Bitmap(fileName)
Line 27:             LarghezzaImmagine = objBMPFoto.Width
Line 28:             AltezzaImmagine = objBMPFoto.Height

Source File: D:\AssociazionePrimoNebiolo_new\_Applicativi\News\box\NewsSingola.ascx.vb    Line: 26

Stack Trace:


[ArgumentException: Parameter is not valid.]
   System.Drawing.Bitmap..ctor(String filename) +639340
   _Applicativi__News_UserControl_NewsSingola.FormView2_PreRender(Object sender, EventArgs e) in D:\AssociazionePrimoNebiolo_new\_Applicativi\News\box\NewsSingola.ascx.vb:26
   System.Web.UI.Control.OnPreRender(EventArgs e) +11728868
   System.Web.UI.Control.PreRenderRecursiveInternal() +132
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Control.PreRenderRecursiveInternal() +227
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3671


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