PDA

View Full Version : AllowPartiallyTrustedCallersAttribute



hosseinmghi
پنج شنبه 30 تیر 1390, 17:21 عصر
سلام دوستان
من چند سال قبل کدی رو در net 2 پیاده سازی کردم.
الان که رو Aspspider آپلود کردم(net 4) با همچین خطایی روبرو شدم.

من اصلا با فرمورک 4 آشنا نیستم.

Attempt by security transparent method '_AspPolling.Page_Load(System.Object, System.EventArgs)' to access security critical method 'Codewriter..ctor()' failed.


Assembly 'App_Web_zugfwzof, Version=1.0.4219.14076, Culture=neutral, PublicKeyToken=null' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.

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 '_AspPolling.Page_Load(System.Object, System.EventArgs)' to access security critical method 'Codewriter..ctor()' failed.

Assembly 'App_Web_zugfwzof, Version=1.0.4219.14076, Culture=neutral, PublicKeyToken=null' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.

Source Error:

Line 13: Directory.CreateDirectory(Server.MapPath("ui" & userid))
Line 14: File.Copy(Server.MapPath("Data/primaryxml.dat"), Server.MapPath("ui" & userid & "/xmlfile_temp.xml"))
Line 15: Dim cw As New Codewriter
Line 16: cw.htmlcode(Server.MapPath("ui" & userid & "/xmlfile_temp.xml"), 0)
Line 17: Literal1.Text = cw.htmlp

hosseinmghi
جمعه 31 تیر 1390, 20:28 عصر
دوستان کسی تا حالا با این مسئله برخورد نداشته؟