Server Error in '/' Application.

Attempt by security transparent method 'fox_news.Page_Init(System.Object, System.EventArgs)' to access security critical method 'Microsoft.VisualBasic.FileSystem.Dir(System.String, Microsoft.VisualBasic.FileAttribute)' failed.

Assembly 'App_Web_avasvoko, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself.  In order to access security critical code, this assembly must be fully trusted.

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.MethodAccessException: Attempt by security transparent method 'fox_news.Page_Init(System.Object, System.EventArgs)' to access security critical method 'Microsoft.VisualBasic.FileSystem.Dir(System.String, Microsoft.VisualBasic.FileAttribute)' failed.

Assembly 'App_Web_avasvoko, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself.  In order to access security critical code, this assembly must be fully trusted.

Source Error:


Line 39:             If Not IsDBNull(dr("immagine")) Then
Line 40:                 If dr("immagine") <> "" Then
Line 41:                     If Dir(Server.MapPath("public/catalogo/img/miniature/" & dr("immagine"))) = dr("immagine") Then
Line 42:                         contenuto = contenuto & "<img src=""public/catalogo/img/miniature/p" & dr("immagine") & """ title=""" & dr("titolo") & """ class=""dx"" />" & vbCrLf
Line 43:                     End If

Source File: D:\inetpub\webs\fox-machinescom\fox-news.aspx.vb    Line: 41

Stack Trace:


[MethodAccessException: Attempt by security transparent method 'fox_news.Page_Init(System.Object, System.EventArgs)' to access security critical method 'Microsoft.VisualBasic.FileSystem.Dir(System.String, Microsoft.VisualBasic.FileAttribute)' failed.

Assembly 'App_Web_avasvoko, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' is partially trusted, which causes the CLR to make it entirely security transparent regardless of any transparency annotations in the assembly itself.  In order to access security critical code, this assembly must be fully trusted.]
   fox_news.Page_Init(Object sender, EventArgs e) in D:\inetpub\webs\fox-machinescom\fox-news.aspx.vb:41
   System.Web.UI.Control.OnInit(EventArgs e) +97
   System.Web.UI.Page.OnInit(EventArgs e) +14
   System.Web.UI.Control.InitRecursive(Control namingContainer) +142
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +416


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