How to read css file from webresource.axd?

1 posts, 0 answers
  1. Alexander
    Alexander avatar
    152 posts
    Member since:
    Jun 2012

    Posted 13 Aug 2012 Link to this post

                                var executingAssembly = Assembly.GetExecutingAssembly();
    //executingAssembly = {App_Web_serversummaryedit.ascx.e5f4f472.hriathhs, Version=, Culture=neutral, PublicKeyToken=null}
                                var webResourceDataArray = NavigationHelper.WebResourceData(webResourceCssPath).Split('|');
                                var webResourceName = webResourceDataArray[webResourceDataArray.Length - 1];
    //webResourceName = Telerik.Web.UI.Skins.Grid.css
                                var resourceStream = executingAssembly.GetManifestResourceStream(webResourceName);
                                if (resourceStream != null)
                                    var cssTextStreamReader = new StreamReader(resourceStream);

    Why this does not work? How to read css from resource file by resource name?? :(

    I suspect instead of Assembly.GetExecutingAssembly() must be something like loading Telerik.Web.UI.dll again? Btw, it resides in GAC.
    So, how to manage all this?

    UPDATE: Done!
    var telerikAssembly = Assembly.GetAssembly(typeof(Telerik.Web.SkinRegistrar));
Back to Top