Chiedo supporto.
Il sito web in questione usa i files .resx (in App_GlobalResources).
Implementa funzioni e front-end per consentire agli utenti di modificare i .resx, così che la traduzione nelle varie Lingue è ottenuta con il loro contributo. Dunque l'applicazione scrive nei .resx. Le funzioni permettono all'utente di scegliere quale Lingua aggiornare e presentano la lista dei files .resx puntando alla directory App_GlobalResources, in questo modo:
=====================================
myLanguages _myLanguages = new myLanguages();
dr = _myLanguages.GetByField("idCountry", whichLanguage);
ResourcesFilePath = pageGlobal.Server.MapPath("App_GlobalResources") + @"\" + dr["CountryResxFileName"];
if (ResourcesFilePath != "")
{
ResXResourceReader resx = new ResXResourceReader(ResourcesFilePath);
IDictionaryEnumerator dictionary = resx.GetEnumerator();
..................
..................
.................. (faccio delle cose)
=====================================
Dopo la "Pubblicazione del sito" tutto il contenuto ottenuto è stato trasferito presso il server di hosting.
Il lancio dell'applicazione restituise l'errore che riporto di seguito:
=========================================
Server Error in '/' Application.
--------------------------------------------------------------------------------
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request failed.]
myResources.ReadForLanguageTranslation() +0
myResources..ctor(Page pg) +490
index.Page_Load(Object sender, EventArgs e) +321
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
System.Web.UI.Page.ProcessRequest() +86
System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) +18
System.Web.UI.Page.ProcessRequest(HttpContext context) +49
ASP.index_aspx.ProcessRequest(HttpContext context) +4
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +358
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +64
====================================
Vorrei capire:
1) se l'operazione "Pubblica sito web" non include la directory "App_GlobalResources", è consentito puntarla come fatto dal codice per la variabile "ResourcesFilePath"?
2) L'errore che si produce può essere in relazione al punto 1) oppure effettivamente si tratta di permessi di accesso? Ma a quale directory dato che App_GloablResources non è inclusa nel precompilato?
GRAZIE. Spero in una risposta quanto prima.

Rispondi quotando