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?
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.
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..
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 + ",";
}
}
}
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.
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.
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..
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.
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.
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.
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: 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...
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.
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)
@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.. :-(
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?
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>
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?
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..
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)
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.
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.
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 :)
@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.
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)
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?
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].
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.
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
This is a bug with the Juno beta unfortunately.
cheers,
doug.
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.
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
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.
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)
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:
...and end with:
Let us know what you find out.
cheers,
doug.
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
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
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.
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
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.
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
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
Ah, that's super... and makes sense!
cheers,
doug.
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.
How would I manually register the extension? I tried:
<ext assembly="__code" type="PS.XSLTsearch" alias="PS.XSLTsearch"> </ext>
But gives me an error.
Hi Yannick,
Have you tried "App_Code"?
Matt
Yes tried App_Code, same problem. Nothing in umbracolog table either.
BTW other code files (contour workflow) are picked up correctly.
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.
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.
Sounds like there is some issue when upgrading from 4.6 beta to 4.6.1 then. Thanks for the report.
cheers,
doug.
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?
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.
If you've upgraded then make sure that:
1) You replace all Microsoft.Scripting.* files
2) Delete Microsoft.Scripting.ExtensionAttribute.dll if it exist
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...
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.
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)
@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
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):
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.
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?
@Yannick: What problem you want to solve? Styles or App_Code XSLT Extensions?
XSLT Extensions. Don't care too much about the styles, just mentioned it in case someone sees a relation between the problems...
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..
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?
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
Hmm still pretty curious what is cousing us to need that dll. Did you have the post-alpha razor package installed?
No, I haven't. I think since Razor support is shipped with 4.6, ASP.NET MVC is required.. Good to know! ;-)
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
Did you run Andreas script?
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.
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:
I solved this problem by copying System.Web.Mvc.dll paste to bin folder too . Thanks .
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.
Still no clue as what is causing the MVC 2 dll dependency...
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
Did you run Andreas' debug script from page 4?
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
Run the script from this post to see which DLL's are missing.
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 :)
@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.
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)
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)
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?
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
Hi, Jenni,
I've answered your question on the new thread you started, at http://our.umbraco.org/projects/website-utilities/xsltsearch/xsltsearch-bugs/28858-Error-when-saving-SearchXSLT-file-in-Umbraco-461-urnPSXSLTsearch
cheers,
doug.
is working on a reply...