Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jonok 297 posts 658 karma points
    Jan 11, 2011 @ 10:12
    jonok
    0

    Error when saving XSLT file in Umbraco 4.6 beta

    I've installed XSLTsearch 3.0 in umbraco 4.6 beta, but when I try to change and save the XSLT file I get the following error:

    System.Xml.Xsl.XslTransformException: Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'.

    The package seems to installed successfully and the XSLTsearch.cs file is in the app_code file. Does anybody know what could be causing the error? Or is XSLTsearch 3.0 not compatible with Umbraco 4.6 beta?

    Thanks.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 11, 2011 @ 10:22
    Jan Skovgaard
    0

    Hi jonok

    What is it exactly you're trying to change? Please provide a snippet of the code. And before you changed anything did it actually work? :-)

    /Jan

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 11, 2011 @ 10:38
    Douglas Robar
    1

    This is a bug with the Juno beta unfortunately.

    cheers,
    doug.

  • jonok 297 posts 658 karma points
    Jan 11, 2011 @ 12:18
    jonok
    0

    OK thanks for clarifying that Doug. I'll wait and see if anything changes with the full release of Juno, or if you end up modifying XSLTsearch to work with Juno.

  • Andreas Pfanner 196 posts 314 karma points
    Jan 14, 2011 @ 10:15
    Andreas Pfanner
    0

    Hello,

    I've done an upgrade from 4.5.2 to 4.6.1 (including upgrade to ASP.NET 4.0) and having the same issue. 
    The XSLTSearch.cs is located at the App_Code directory, permissions are okay..

    Any guess?

     

    Regards,

    Andreas

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 14, 2011 @ 12:56
    Douglas Robar
    0

    I didn't have a problem on 4.6.1, though didn't try an upgraded site. Hopefully others will have some insight into what might be happening.

    cheers,
    doug.

  • Andreas Pfanner 196 posts 314 karma points
    Jan 14, 2011 @ 13:38
    Andreas Pfanner
    0

    Here's the exact error message I get when I try to save the XSLTSearch.xslt file:

     

     

    Error occured

    System.Xml.Xsl.XslTransformException: Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'. 

    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) 

    at startTime(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 

    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) 

    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) 

    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) 

    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 14, 2011 @ 13:57
    Douglas Robar
    0

    This is caused by Umbraco not picking up the .cs file in the app_code folder. The question is... why is that happening?

    Since xslt extensions in the app_code folder works in Umbraco 4.5 and 4.6 that isn't the problem. More info about app_code XSLT extensions at http://blog.percipientstudios.com/2010/11/12/make-an-app_code-xslt-extension-for-umbraco.aspx

    And yet your installation of Umbraco doesn't notice the xslt extension. I suspect one of two things has happened...

    1. Your website's application pool 'owner' doesn't have enough permission to read the .cs file in the app_code folder. Please triple-check this.

    2. The .cs file in the app_code folder is corrupt. Download XSLTsearch and open the .zip file from the filesystem. Copy the .cs file to your app_code folder.

    FWIW, the XSLTsearch.cs file should begin with:

    using System;
    using System.Collections;
    using umbraco;
    
    namespace PS
    {
        [XsltExtension]
    
        public class XSLTsearch
        {
            public XSLTsearch() { }
    

    ...and end with:

           public static string getListParameter(string value, string defaultValue)
            {
                // remove all spaces
                value = value.Replace(" ", "");
                defaultValue = defaultValue.Replace(" ", "");
    
                if (value == "")
                    return "," + defaultValue + ",";
                else
                    return "," + value + ",";
            }
        }
    }
    

    Let us know what you find out.

    cheers,
    doug.

  • Andreas Pfanner 196 posts 314 karma points
    Jan 14, 2011 @ 14:20
    Andreas Pfanner
    0

    Hello Doug,

    1. That's okay, I even set full access for everyone for testing purposes..

    2. The file is definitely valid.

    So, thats very strange..


    Regards,

    Andreas

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 14, 2011 @ 14:25
    Matt Brailsford
    0

    It's not a fix to the actual issue, but you could register the XsltExtensions in the config/xsltExtensions.config file manually.

    As doug says though, tripple check permissions, and that you copied over the latest DLLs.

    Mattq

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 14, 2011 @ 14:26
    Douglas Robar
    0

    Well, it's nice to know some of the things it is NOT :)

    Here's an option... can you uninstall the XSLTsearch package from the Packages section in the Developer area? Then, recycle your site's application pool (either via IIS or 'touch' the web.config file). After the site restarts, install XSLTsearch again. Not sure it will make any difference but worth a shot.

    cheers,
    doug.

  • Andreas Pfanner 196 posts 314 karma points
    Jan 14, 2011 @ 16:03
    Andreas Pfanner
    0

    Hello,

    no success yet :-(

    Tried to uninstall - Umbraco could not delete the following files:

    - xslt/XSLTsearch.xslt
    - App_Code/XSLTsearch.cs

    I removed these files manually and re-installed the package, which works (so permissions should be okay, right?).
    But: After all, nothing changed. 

    Actually "Everyone" has full access to the whole Umbraco directory (test environment).

    Furthermore I only have another issue with my 4.6.1 upgraded installation, but I don't think that there is a connection?!
    http://our.umbraco.org/forum/getting-started/installing-umbraco/13014-MicrosoftScriptingExtensionAttribute-missing

     

    Best Regards

    Andreas

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 14, 2011 @ 16:06
    Douglas Robar
    0

    Very curious. Interesting that umbraco (that is, the site's application pool) couldn't delete the files. That might be indicative of a problem. If everyone has full control then there would be no problem deleting the files. I think there just must be some file permission issue that is causing both of these problems.

    cheers,
    doug.

  • Andreas Pfanner 196 posts 314 karma points
    Jan 14, 2011 @ 16:16
    Andreas Pfanner
    0

    Forgot to say that the uninstall routine could not delete the XSLTSearch.xslt file, but I was able to delete it in Umbraco's XSLT section. So in fact Umbraco COULD delete the file, but not the package uninstaller.. Even more courious.. I only had to remove the .cs file directly on the file system..

     

    Best Regards
    Andreas

     

  • Andreas Pfanner 196 posts 314 karma points
    Jan 14, 2011 @ 16:56
    Andreas Pfanner
    0

    Update: Seems that there IS a connection to my other issue on 4.6.1. After fixing the Microsoft.Scripting.ExtensionAttribute problem (our.umbraco.org/.../13014-MicrosoftScriptingExtensionAttribute-missing), the XSLTSearch.xslt file can be saved properly!


    Thanks,
    Andreas

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 14, 2011 @ 17:03
    Douglas Robar
    0

    Ah, that's super... and makes sense!

    cheers,
    doug.

  • Yannick Smits 321 posts 718 karma points
    Jan 14, 2011 @ 17:08
    Yannick Smits
    0

    I have the same issue (Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'.). But don't have the ExtensionAttribute error.

    It happened to me after upgrading from 4.6.alpha to 4.6.1.

    Gonna try to manually register the XSLT extension in config.

  • Yannick Smits 321 posts 718 karma points
    Jan 14, 2011 @ 17:20
    Yannick Smits
    0

    How would I manually register the extension? I tried:

      <ext assembly="__code" type="PS.XSLTsearch" alias="PS.XSLTsearch">  </ext>

    But gives me an error.

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Jan 14, 2011 @ 17:25
    Matt Brailsford
    0

    Hi Yannick,

    Have you tried "App_Code"?

    Matt

  • Yannick Smits 321 posts 718 karma points
    Jan 14, 2011 @ 17:28
    Yannick Smits
    0

    Yes tried App_Code, same problem. Nothing in umbracolog table either.

    BTW other code files (contour workflow) are picked up correctly.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 15, 2011 @ 12:04
    Douglas Robar
    0

    XSLTsearch is the first tool to use the app_code XSLT extension. All others are pre-compiled binary extensions, which may be why this issue appears with XSLTsearch but not other extensions.

    Can you unzip a fresh copy of Umbraco 4.6.1 and compare the files to those in your upgraded site? Tools such as WinMerge are ideal for this. I suspect there is a file missing or out of date after the upgrade from the beta.

    cheers,
    doug.

  • jonok 297 posts 658 karma points
    Jan 15, 2011 @ 12:13
    jonok
    0

    I've now installed Umb 4.6.1 and its working fine for me. I upgraded the beta site that I was working on by creating a new empty 4.6.1 site, and then copied all xslt,css,usercontrols,master pages, and the web.config from my 4.6 beta site (except for the xsltsearch files). Then I installed the XSLTsearch package and its working.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 15, 2011 @ 12:15
    Douglas Robar
    0

    Sounds like there is some issue when upgrading from 4.6 beta to 4.6.1 then. Thanks for the report.

    cheers,
    doug.

  • Andreas Pfanner 196 posts 314 karma points
    Jan 17, 2011 @ 19:17
    Andreas Pfanner
    0

    Hi,

    on my test environment, I got it working by fixing the Microsoft.Scripting.ExtensionAttribute issue. But it seems, that this was by accident. Trying to upgrade my live site, I got the same problem, and the ExtensionAttribute solution doesn't change anything to the XSLTSearch issue.

    I even tried to uninstall the XSLTSearch package on 4.5.2  before upgrading, and reinstall it on 4.6.1, but that does't help as well.. :-( Any suggestions?

     


    The question is: Why 4.6.1 doesn't pick up the App_Code XSLT extension or: how to get it picked up?

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 18, 2011 @ 10:40
    Douglas Robar
    0

    Hi, Andreas,

    You're right... the question is, why do upgraded sites (sometimes) not pick up the App_Code XSLT extension?

    In your case, am I right in thinking you moved from .NET 3.5 to .NET 4.0 as part of the upgrade? Perhaps that's related?

    cheers,
    doug.

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jan 18, 2011 @ 10:45
    Niels Hartvig
    0

    If you've upgraded then make sure that:

    1) You replace all Microsoft.Scripting.* files

    2) Delete Microsoft.Scripting.ExtensionAttribute.dll if it exist

  • Andreas Pfanner 196 posts 314 karma points
    Jan 18, 2011 @ 10:57
    Andreas Pfanner
    0

    Hi,

    Douglas: yes, I just moved to 4.0 with the upgrade. I also thought about that, but I cannot imagine whats the problem..

    Niels: I am sure that I replaced Microsoft.Scripting.dll and Microsoft.Scripting.Debugging.dll (just checked this again). I had no Microsoft.Scripting.ExtensionAttribute.dll, but I instead I had to remove the Microsoft.Scripting.Core.dll in order to solve the ExtensionAttribute issue. On my test environment, this magically solves the App_Code issue as well, but on stage it doesn't...

  • Yannick Smits 321 posts 718 karma points
    Jan 18, 2011 @ 12:16
    Yannick Smits
    0

    heeelp, just wrote a lenghty post about my setup and the result of the winmerge and my post is gone after hitting submit! Using Chrome 8.0, pff. Will do a recap:

    Nothing strange in the winmerge result, just some stuff related to installed components (contour, runway).

    Only odd thing I noticed is that in the backend after the timeout has expired the modal popup has no styles attached, so its transparent and looks odd. Also after hitting 0 seconds the GetSecondsBeforeUserLogout method throws a 500 internal server error with: "{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}".

    Before upgrading I was already on .NET 4.0. Server is windows server 2003.

  • Yannick Smits 321 posts 718 karma points
    Jan 18, 2011 @ 12:28
    Yannick Smits
    0

    just found this line in the umbracoLog at app startup:
    Can't import MacroEngine 'umbraco.MacroEngines.Legacy.DLRScriptingEngine': System.ArgumentException: An item with the same key has already been added.     at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)     at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)     at umbraco.cms.businesslogic.macro.MacroEngineFactory.getEngines(List`1 types)

  • Andreas Pfanner 196 posts 314 karma points
    Jan 18, 2011 @ 13:39
    Andreas Pfanner
    0

    @Yannick: Concerning the style problems (I had the same issues) - this should help: http://our.umbraco.org/forum/using/ui-questions/16295-Juno-(461)-backend-styles

    @All: Concerning the App_Code issue. Haven't found a solution yet. On my test environment, it really seems to be the existence of Microsoft.Scripting.Core.dll (ExtensionAttribute error) in the bin directory. If I remove the file, Macro Extensions from App_Code are working, else they are not working (can reproduce this). The strange thing in fact is, that on my live environment (where I made the same upgrade steps), it doesn't help to remove the .dll.. :-(

    Regards
    Andreas

  • Andreas Pfanner 196 posts 314 karma points
    Jan 18, 2011 @ 15:19
    Andreas Pfanner
    1

    Hey,

    I finally found something out by doing some deep code review and testing:

    In 4.6.1, XSLT Extensions from App_Code are registered in the following block (macro.cs):

    try
    {
        foreach (Type xsltType in BusinessLogic.Utils.TypeFinder.FindClassesMarkedWithAttribute(typeof(XsltExtensionAttribute)))
        {
            object[] tpAttributes = xsltType.GetCustomAttributes(typeof(XsltExtensionAttribute), true);
            foreach (XsltExtensionAttribute tpAttribute in tpAttributes)
            {
                if (tpAttribute.Namespace != String.Empty)
                {
                    extensions.Add(tpAttribute.Namespace, Activator.CreateInstance(xsltType));
                }
                else
                {
                    extensions.Add(xsltType.FullName, Activator.CreateInstance(xsltType));
                }
            }
        }
    }
    catch { }
    
    I think, that by calling FindClassesMarkedWithAttribute(Type attribute) there is an error thrown, but you don't notice because of try-catch (and no log entry). The error should occur here:
    bool searchGAC = false;
    
                foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
                {
                    //don't check any types if the assembly is part of the GAC
                    if (!searchGAC && assembly.GlobalAssemblyCache)
                        continue;
    
                    foreach (Type type in assembly.GetTypes()) // ERROR!!
                    {
                        if (type.GetCustomAttributes(attribute, true).Length > 0) 
                        {
                            types.Add(type);
                        }
                    }
    
                }
    The error occurs on assembly RazorEngine.Templates.dll, the problem seems to be:

    System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. File name: 'System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

    Comparing my live environment to my test environment I see, that on the test environment there is System.Web.Mvc in the GAC, while its not on the live environment.
    Conclusion: By removing RazorEngine.Templates.dll (just testing), App_Code XSLT extensions are picked up by umbraco correctly. But: Why System.Web.Mvc it doesn't exist on the live environment (where does it come from on the test system), and how to get it? Generally I guess that this behaviour isn't intended by umbraco dev team, isn't it? Is it a bug in 4.6.1?
  • Yannick Smits 321 posts 718 karma points
    Jan 18, 2011 @ 15:38
    Yannick Smits
    0

    great research Andreas! I just tried:
    - remove RazorEngine.Templates.dll
    and
    - install ASP.NET MVC 3

    both not fixing the problem. Still message in log about DLRScriptingEngine. Do you have this message too in your log?

  • Andreas Pfanner 196 posts 314 karma points
    Jan 18, 2011 @ 15:50
    Andreas Pfanner
    0

    @Yannick: What problem you want to solve? Styles or App_Code XSLT Extensions?

  • Yannick Smits 321 posts 718 karma points
    Jan 18, 2011 @ 15:50
    Yannick Smits
    0

    XSLT Extensions. Don't care too much about the styles, just mentioned it in case someone sees a relation between the problems...

  • Andreas Pfanner 196 posts 314 karma points
    Jan 18, 2011 @ 16:13
    Andreas Pfanner
    5

    Styles should be easy to solve. Just follow the link to the topic I posted.

    Yes, I also had this log entry, but not recently (last time in the morning I think).. 

    XSLT Extensions: You already made sure that Microsoft.Scripting.Core.dll / Microsoft.Scripting.ExtensionAttribute is removed from bin?

     

    You may try my little test script to see if there some other assembly errors. Just place this to a .aspx in our /umbraco/ directory. You will also see which Types from App_Code are loaded properly..

    <%@Import Namespace="System.IO" %>
    <%@Import Namespace="umbraco" %>
    <%@Import Namespace="umbraco.IO" %>
    <%@Import Namespace="System.Reflection" %>
    <script langauge="C#" runat="server">
    
    public void Page_Load(object sender, EventArgs e)
    {
     Type attribute = typeof(XsltExtensionAttribute);
            bool searchGAC = false;
    
                foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
                {
                    //don't check any types if the assembly is part of the GAC
                    if (!searchGAC && assembly.GlobalAssemblyCache)
                        continue;
    
                        try
                        {
                            foreach (Type type in assembly.GetTypes())
                            {
                                // do nothing
                            }
                        }
                        catch (ReflectionTypeLoadException ex){
                            Response.Write("Assembly: " + assembly);
                            Response.Write("<br/>Exception: " + ex.LoaderExceptions[0]);
                    }
    
                }
    
                DirectoryInfo appCodeFolder = new DirectoryInfo(IOHelper.MapPath(IOHelper.ResolveUrl("~/App_code")));
                if (appCodeFolder.GetFiles().Length > 0)
                {
                    foreach (Type type in System.Reflection.Assembly.Load("App_Code").GetTypes())
                    {
                        if (type.GetCustomAttributes(attribute, true).Length > 0)
                        {
                            Response.Write("<br/><br/>Types from App_Code: "+ type.ToString());
                        }
                    }
    
                }
                }
    
    </script>
  • Yannick Smits 321 posts 718 karma points
    Jan 18, 2011 @ 16:32
    Yannick Smits
    1

    Ah! Same thing as you, missing ASP.NET MVC 2 assemblies...

    Now copied the asp.net mvc dll from my machine (C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 2\Assemblies) to the /bin directory on the server and now the XSLTsearch is fixed!!

    I have AjaxControlToolkit.dll in my bin directory which i think has a reference to the asp.net mvc 2 assembly. AjaxControlToolkit was brought there by Contour so there might be the problem... Do you have contour too Andreas?

  • Andreas Pfanner 196 posts 314 karma points
    Jan 18, 2011 @ 16:37
    Andreas Pfanner
    0

    Hi,

    I just installed ASP.NET MVC 2 using Web Platform Installer, which does the trick for me (+ recycle/restart app afterwards) - think it's the easiest solution to fix it..

    I don't have AjaxControlToolkit.dll in my bin, and I don't have Contour as well..

    Best Regards

    Andreas

  • Yannick Smits 321 posts 718 karma points
    Jan 18, 2011 @ 16:42
    Yannick Smits
    0

    Hmm still pretty curious what is cousing us to need that dll. Did you have the post-alpha razor package installed?

  • Andreas Pfanner 196 posts 314 karma points
    Jan 18, 2011 @ 16:57
    Andreas Pfanner
    0

    No, I haven't. I think since Razor support is shipped with 4.6, ASP.NET MVC is required.. Good to know! ;-)

  • sun 403 posts 395 karma points
    Jan 24, 2011 @ 03:00
    sun
    0
    umbracoMacro InnerException Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'.
    Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'.
      at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
      at System.Xml.Xsl.CompiledQuery.Query.startTime(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) in D:\localUser\gqcxxb\Sites\Umbraco46\xslt\XSLTsearch.xslt:line 33
      at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
      at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
      at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
      at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
      at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
      at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
      at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)

    I have this error too

  • Yannick Smits 321 posts 718 karma points
    Jan 24, 2011 @ 09:28
    Yannick Smits
    0

    Did you run Andreas script?

  • sun 403 posts 395 karma points
    Jan 26, 2011 @ 15:07
    sun
    0

    I have solved this problem. just copy dll of asp.net mvc2 to bin folder of Umbraco, it's only one file.

    all looks OK.

  • Yannick Smits 321 posts 718 karma points
    Jan 26, 2011 @ 15:19
    Yannick Smits
    1

    Alternatively if you already have MVC 3 installed on your server you can save yourself some RAM and add this line to your web.config:

     

    <configuration>
     <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    </configuration>

     

  • LordToro 9 posts 29 karma points
    Jan 31, 2011 @ 09:08
    LordToro
    0

    I solved this problem by copying System.Web.Mvc.dll paste to bin folder too . Thanks .

  • Stephen 767 posts 2273 karma points c-trib
    Feb 03, 2011 @ 18:43
    Stephen
    0

    The root issue is that when Umbraco loads the xslt extensions, it basically hides a lot of errors.
    In XSLTSearch case, it fails at loading some assemblies (because of some missing MVC and Razor DLLs), and just quietly stops loading XSLT extensions.

    I have pushed a patch onto my 20110126 fork, which lets Umbraco throw exceptions when this happens.
    I have tested it with a situation similar to yours: now, Umbraco dies and reports the DLL load error.
    Should be easier to troubleshoot, then.

  • Yannick Smits 321 posts 718 karma points
    Feb 03, 2011 @ 18:47
    Yannick Smits
    0

    Still no clue as what is causing the MVC 2 dll dependency...

  • usman 24 posts 43 karma points
    Feb 17, 2011 @ 08:39
    usman
    0

    Hi,

         I am facing the same problem with search parsing. I am using umbraco v 4.6.1and search package XSLTsearch 3.0. I have recently upgraded the umbraco version. After upgrading I am getting this error while saving xslt.

    "System.Xml.Xsl.XslTransformException: Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'.
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at startTime(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)"

    I have tried mvc2 dll solution but it didn't work for me.

    Any further ideas how to sort out this xslt search parsing error.

     

    Thanks,

    Usman

     

  • Yannick Smits 321 posts 718 karma points
    Feb 17, 2011 @ 12:08
    Yannick Smits
    0

    Did you run Andreas' debug script from page 4?

  • usman 24 posts 43 karma points
    Feb 17, 2011 @ 13:40
    usman
    0

    Hi Yannick,

                     I didn't installed the mvc2 but I have put the dll of mvc2 in my umbraco bin directory, which andreas has installed. But it didn't work for me.

    Can you please specify the script which can do the trick for me?

    Thanks,

    Usman

  • Yannick Smits 321 posts 718 karma points
    Feb 17, 2011 @ 13:54
    Yannick Smits
    0

    Run the script from this post to see which DLL's are missing.

  • Alex Norcliffe 222 posts 287 karma points
    Feb 17, 2011 @ 16:12
    Alex Norcliffe
    0

    Just quickly diving in, my gut is that this may be the issue - the code which finds all types containing the [XsltExtension] attribute tries to load each assembly in the bin. Up until that point, not all assemblies would have been loaded into the AppDomain - only those which had been needed.

    In loading the assemblies, .NET eventually gets to Razor.Templates.dll which might have a dependency on MVC. So at that point, .NET checks if all of that assembly's dependencies can be found because it needs them all in order to use any types in Razor.Templates.dll

    The chain effect is that by searching for all [XsltExtension] attributes it can cause .NET to try to load a type which may otherwise have sat there in the bin unused. 

    Disclaimer: I just saw this on Twitter and this is my first stab at a diagnosis :)

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Feb 17, 2011 @ 16:25
    Niels Hartvig
    0

    @Alex It is *indeed* the reason. This will be fixed in 4.6.2 as we change the razor engine completely and no longer have dependencies on those assemblies.

  • usman 24 posts 43 karma points
    Feb 18, 2011 @ 08:08
    usman
    0

    Hi Yannick,

                      I have run the script. It's excellent and gives full trace out. Well it gives the following error while tracing:(Any ideas about this error)

    umbracoMacro InnerException

    Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'.
    Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'.
      at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
      at System.Xml.Xsl.CompiledQuery.Query.startTime(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) in C:\Inetpub\wwwroot\VITAFlow\xslt\XSLTsearch.xslt:line 33
      at System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
      at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
      at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
      at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
      at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
      at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
      at umbraco.macro.loadMacroXSLT(macro macro, MacroModel model, Hashtable pageElements)

     

     

     

    1,3284613213435  0,045612
  • Yannick Smits 321 posts 718 karma points
    Feb 18, 2011 @ 10:57
    Yannick Smits
    0

    That's not the expected output. The script should not throw an error but should list 1 or 2 dll's that give problems. Did you save the script to an aspx file and put it into the /umbraco/ folder?

  • Jenni Marsh 26 posts 46 karma points
    Feb 16, 2012 @ 17:23
    Jenni Marsh
    0

    Hi All,

    I've been getting the  Cannot find a script or an extension object associated with namespace 'urn:PS.XSLTsearch'.   I'veissue mentioned in this thread. I ran the script mentioned on page 4 of the thread and got the output below. Can anyone advise about this mysterious "Castle.DynamicProxy2"? :-)

    Thanks,
    Jenni 

    Assembly: Remotion, Version=1.13.52.2, Culture=neutral, PublicKeyToken=0669cf0452175907
    Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Castle.DynamicProxy2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' or one of its dependencies. The system cannot find the file specified. File name: 'Castle.DynamicProxy2, Version=2.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc' WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 

    Types from App_Code: PS.XSLTsearch

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Feb 22, 2012 @ 11:36
Please Sign in or register to post replies

Write your reply to:

Draft