string strGlobalResources = Server.MapPath("~/App_GlobalResources/ContentDesigner/");
string xsltfile = Server.MapPath(ResolveUrl("resxdata.xslt"));
string strLang = System.Threading.Thread.CurrentThread.CurrentUICulture.Name;
string xmlfile = strGlobalResources + strResourceName + "." + strLang + ".resx";
if (!System.IO.File.Exists(xmlfile))
{
strLang = System.Threading.Thread.CurrentThread.CurrentUICulture.Parent.Name;
xmlfile = strGlobalResources + strResourceName + "." + strLang + ".resx";
if (!System.IO.File.Exists(xmlfile))
{
xmlfile = strGlobalResources + strResourceName + ".resx";
}
}
string strXml = Ektron.Cms.EkXml.XSLTransform(xmlfile, xsltfile, true, true, null, true, null);
litOutput.Text = strXml;
If you examine the above code you will see a resx file is tried to be transformed using xslt. But as in the precoimpiled project we do not have these files physically exist the operation fails.
What I Tried:
Getting the issue, without giving too much thinking I just copied the App_GlobalResources folder to the root of precompiled site and was expecting it would be fixed. But after doing this I got the error “The directory 'App_GlobalResources' is not allowed because the application is precompiled.” Then, I realized this is not a solution. After thinking on this for a few minute I came to 2 solutions of the problem. One is staright rollback to the uncomplied version and the other is doing a trick.
Solution:
Step 1: Rename the App_GlobalResources folder to something else like “AppGlobalResources”.
Step 2: Change your code so that the resx file is taken from the newly named folder instead of App_GlobalResources.
The above 2 steps should solve the problem. This is actually an workaround. But Ektron should not have writen the code in this way. Instead it should have been done through dot net API.
J Get Going J