Problem reading .ini file --> "Attempt by security transparent method"

marco.santilli@2023

New member
Joined
Sep 3, 2023
Messages
1
Programming Experience
5-10
I have problems reading an .ini file in the public folder
everything works locally, both under iss and in visual studio 2019 virtualization
but when i go online i get this text

-------------------------------------------------------------
Attempt by security transparent method 'TradingDomasa.IniFile2.ReadValue(System.String, System.String)' to call native code through method 'TradingDomasa.IniFile2.GetPrivateProfileString(System.String ByRef, System.String ByRef, System.String ByRef, System.Text.StringBuilder, Int32, System.String ByRef)' failed. Methods must be security critical or security safe-critical to call native code.


[MethodAccessException: Attempt by security transparent method 'TradingDomasa.IniFile2.ReadValue(System.String, System.String)' to call native code through method 'TradingDomasa.IniFile2.GetPrivateProfileString(System.String ByRef, System.String ByRef, System.String ByRef, System.Text.StringBuilder, Int32, System.String ByRef)' failed. Methods must be security critical or security safe-critical to call native code.]
TradingDomasa.IniFile2.ReadValue(String section, String key) +99
TradingDomasa.About.LeggoINI01() +119
TradingDomasa.About.Page_Load(Object sender, EventArgs e) +5
System.Web.UI.Control.OnLoad(EventArgs e) +97
System.Web.UI.Control.LoadRecursive() +61
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693

---------------------------------------------------------------

instead if I try to read an XML file always present in the public folder, it doesn't give me an error and everything works correctly

Do you have any tips to try?

Hello and thanks
 

Latest posts

Back
Top