After installing uLess all seemed fine until I selected [Create] on th e Less node. I get the following error:
The create dialog for "initlessFiles" does not match
anything defined in the "~/umbraco/config/create/UI.xml". This could
mean an incorrectly installed package or a corrupt UI file
This a clean install of Ver 4.7.1 I'm running IIS5.1 and .Net 4.0
Disclaimer: I have very little experience with packages, much less uLess itself.
With the statement above it is obvious I'm going to be pulling straws here, but:
Did you check the create/UI.xml file for 'uLess' related entries? That might be a start, as it could at least tell you if the installation managed to change the file at all.
How immediate was all this? I've noticed that version 5 has really aggressive caching (yes, unbelievably, even for developer and settings sections); the consequence of this means that creating a folder, or a cshtml file under Partials, for example, would actually physically be there, but the UI cache is not up to date (in the cases I've experienced this is indicated by the erros being db related: the db and UI data are not aligned).
Now, all of this seems rather tangential to your actual problem, I know, but I'm just throwing a suggestion out there: I don't know if package configurations are preloaded and cached, and so it could, at a var stretch, possibly be related.
I haven't looked yet but yes I guess there is a directive missing. I also guess this is down to incorrect permissions when uLess was trying to write to or create a file. These are just guesses though. I now have quite a bit of experience with umbraco but there are a LOT of dark corners so I still consider myself a virgin. I am going to try setting permissions throughout to FULL and try again to see if that works and then work my way back from there. Slow but sure. It would be nice to know what folders and files need what permissions (for uLess) though. If I knew what should be in the UI.xml I can add it in manually @Justin?
Like William said, it could be that when the installer ran it did not have the proper permissions to write to this file. If they are there please let me know and we can dig further to see if this is something else.
I have adapted the examples to allow for cacls (XP and win 2000) and icacls (pretty well the rest). I am running XP and therefore cacls. cacls does not seem to allow for setting sub-folders to inherit permissions, so it looks like I have to explicitly set permissions per folder and file (unless someone knows otherwise). A real pain but in theory doable.
I will add set permissions to /umbraco/config/create/UI.xml and reinstall to see if that fixes it.
If there are any other permissions that I need to set could you let me know?
Hmm, I can't seem to uninstall uLess. Clicking the uninstall button doesn't do anything. I tried reinstalling without uninstalling and now I appear to have two uLess packages installed.
However I have now created a .less file and changed my reference in the master page but it doesn't seem to be creating the css. Should there be something in the web.config that I am missing? The DLLs seem to have installed OK.
If I can manually fix this, I'll then do another fresh install and see if I can get it working in that.
I am glad that fixed it for you. I don't know of any other permissions that you would need. As far as I know we only update that UI.xml file, web.config (to add the httpHandler for dotLess), and add the .dlls to the bin directory.
Yup, they are missing, adding them in doesn't seem to have worked. I'll try a reboot and if that fails I've tweaked my permissions batch file and I'll do a complete fresh install.
Keep us posted. Also, in your template did you add a type="text/css" to the link tag? If you don't the browser won't render it. You can also try to make a request directly to the file url to see if it renders you a css file, to verifiy the httpHandler is working.
I am glad that it worked for you. I would love to take a look at your permissions script. Maybe we can add that to the read me file or the wiki for IIS5/XP users. I have a XP machine I can test it out on to make sure it works. If you don't mind include any attributions you can find in a comment block at the top of the script.
Can you drop me an email on william[dot]charlton[at](I'm sure the spam bots have sussed all these obfuscated emails by now)@gmail.com?
The batch file should work on XP or 2003, 2008 etc and I be interested to get some feedback
I am in the process of writing an Umbraco help site so this (batch file) will definitely be there as it is one of the main areas of problems. I think uLess should also be there because IMHO it is the way ahead.
I have added attributions to the people who wrote the original code in the bat file. I've seen what happens if you don't!
:( I think I spoke too soon. When I said it worked, I had written straight CSS in the .less file and that was rendering fine (browsers will read any text file as CSS as long as the type="text/css"), when I started to play with .less it wasn't so good.
I have the following simple .less code:
@Red: #f00;
.test{color:@Red;font-weight:bold}
The HTML is <p class="test">Test uLess</p>
The output is bold text but no color.
All the bits seem to be in place (dlls, web.config, UI.xml)
If you open the rendered CSS directly what does it display. It could be that the dotLess http handler is either throwing a compilation error, or that it is getting a 404 when trying to locate your .less file.
I have a feeling the problem is with IIS. I am looking into how .less is mapped to the .Net engine which is what I think is missing. 4 Guys have a bit of explanation but ony half the story on http://www.4guysfromrolla.com/articles/030310-1.aspx
Right, NOW it works. I had to add .less into the asp .Net engine. Not dead straightforward.
In IIS 5.1 open web site properties.
Go to Home Directory tab
Click [Configuration] in Application settings area
Select an existing setting e.g. aspx (we know they work) and select [Edit]
Copy the path to the executable and close
Click [Add]
Paste the path into the Executable box
Type ".less" into the Extension box (without the quotes)
Leave "All verbs" selected
Uncheck "Check that file exists" and make sure that "Script Engine" is checked
Save
I expect that you have to restart IIS but I'm not sure as I restarted anyway because I was doing a re-install.
Incidentally, the reason I was doing the reinstall was that I thought I would try installing uBootstrap as I was having trouble getting uLess going. uBootstrap seemed to install but I got an http timeout error (I don't know what it was trying to do). So rather than waste time trying something that might not have fully installed I uninstalled it. Duh.
Some and only some DLLs and references are shared between UBootstrap and uLess so the site fell over as uninstalling uBootstrap deleted the DLLs but not the refs in the web.config.
Thank you for all the work fleshing out this solution. I have not used XP's IIS 6 for any umbraco work. I found that it was much easier and pain free to use IISExpress which you can get as part of WebMatrix. It has the same guts as IIS7 and will run using your current credentials, so you don't have all of the permissions issue. Another benefit is you can simply right click on any directory and choose "Open as website in WebMatrix". Now you have a local webserver open with a pretty decent IDE that even has a "Open in VS2010" button. :)
I believe that you can probably make the .less file mapping in your web.config as well. You might want to check because when you added the file mapping using the IIS manager, it probably made the change in your local web.config unless you set it at the server node level.
Error trying to create a .less file
After installing uLess all seemed fine until I selected [Create] on th e Less node. I get the following error:
The create dialog for "initlessFiles" does not match anything defined in the "~/umbraco/config/create/UI.xml". This could mean an incorrectly installed package or a corrupt UI file
This a clean install of Ver 4.7.1 I'm running IIS5.1 and .Net 4.0
Any ideas?
Disclaimer: I have very little experience with packages, much less uLess itself.
With the statement above it is obvious I'm going to be pulling straws here, but:
Did you check the create/UI.xml file for 'uLess' related entries? That might be a start, as it could at least tell you if the installation managed to change the file at all.
How immediate was all this? I've noticed that version 5 has really aggressive caching (yes, unbelievably, even for developer and settings sections); the consequence of this means that creating a folder, or a cshtml file under Partials, for example, would actually physically be there, but the UI cache is not up to date (in the cases I've experienced this is indicated by the erros being db related: the db and UI data are not aligned).
Now, all of this seems rather tangential to your actual problem, I know, but I'm just throwing a suggestion out there: I don't know if package configurations are preloaded and cached, and so it could, at a var stretch, possibly be related.
Grant,
I haven't looked yet but yes I guess there is a directive missing. I also guess this is down to incorrect permissions when uLess was trying to write to or create a file. These are just guesses though. I now have quite a bit of experience with umbraco but there are a LOT of dark corners so I still consider myself a virgin. I am going to try setting permissions throughout to FULL and try again to see if that works and then work my way back from there. Slow but sure. It would be nice to know what folders and files need what permissions (for uLess) though.
If I knew what should be in the UI.xml I can add it in manually @Justin?
The file /umbraco/config/create/UI.xml should have these nodes:
<nodeType alias="initlessFiles">
<header>Less Files</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<create assembly="uLess.Core" type="Tasks.LessFilesTasks" />
</tasks>
</nodeType>
<nodeType alias="lessFiles">
<header>Less Files</header>
<usercontrol>/create/simple.ascx</usercontrol>
<tasks>
<create assembly="uLess.Core" type="Tasks.LessFilesTasks" />
<delete assembly="uLess.Core" type="Tasks.LessFilesTasks" />
</tasks>
</nodeType>
Like William said, it could be that when the installer ran it did not have the proper permissions to write to this file. If they are there please let me know and we can dig further to see if this is something else.
Justin
Justin,
Thanks, adding that node seems to have fixed it. I have a batch file which sets my permissions, adapted from the examples on:
http://our.umbraco.org/wiki/install-and-setup/set-umbraco-folder-permissions-from-command-line
and http://blog.mattbrailsford.com/2010/08/01/adding-a-windows-context-menu-item-to-set-umbraco-folder-permissions/
I have adapted the examples to allow for cacls (XP and win 2000) and icacls (pretty well the rest). I am running XP and therefore cacls. cacls does not seem to allow for setting sub-folders to inherit permissions, so it looks like I have to explicitly set permissions per folder and file (unless someone knows otherwise). A real pain but in theory doable.
I will add set permissions to /umbraco/config/create/UI.xml and reinstall to see if that fixes it.
If there are any other permissions that I need to set could you let me know?
Thanks for your help.
Hmm, I can't seem to uninstall uLess. Clicking the uninstall button doesn't do anything. I tried reinstalling without uninstalling and now I appear to have two uLess packages installed.
However I have now created a .less file and changed my reference in the master page but it doesn't seem to be creating the css. Should there be something in the web.config that I am missing? The DLLs seem to have installed OK.
If I can manually fix this, I'll then do another fresh install and see if I can get it working in that.
I am glad that fixed it for you. I don't know of any other permissions that you would need. As far as I know we only update that UI.xml file, web.config (to add the httpHandler for dotLess), and add the .dlls to the bin directory.
Justin
I am not sure about the uninstall issue. That could be a permission thing too.
In the web.config you should have these entries:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<httpHandlers>
<add path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" />
</httpHandlers>
<system.webServer>
<handlers accessPolicy="Read, Write, Script, Execute">
<remove name="DotLessCss" />
<add name="DotLessCss" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler, dotless.Core" preCondition="integratedMode" />
</handlers>
</system.webServer>
</configuration>
Yup, they are missing, adding them in doesn't seem to have worked. I'll try a reboot and if that fails I've tweaked my permissions batch file and I'll do a complete fresh install.
Keep us posted. Also, in your template did you add a type="text/css" to the link tag? If you don't the browser won't render it. You can also try to make a request directly to the file url to see if it renders you a css file, to verifiy the httpHandler is working.
Justin,
Brilliant!! Once I sorted the permissions problems I had, it worked like a dream. Do you have any guidelines on setting cacheing?
Do you also want a copy of my batch file for testing with? I'm not sure it is ready for release but you are welcome to have a play with it.
I wonder if I should check any attributions I might have overlooked before I send it to you ;)
William,
I am glad that it worked for you. I would love to take a look at your permissions script. Maybe we can add that to the read me file or the wiki for IIS5/XP users. I have a XP machine I can test it out on to make sure it works. If you don't mind include any attributions you can find in a comment block at the top of the script.
Thanks!
Justin,
Can you drop me an email on william[dot]charlton[at](I'm sure the spam bots have sussed all these obfuscated emails by now)@gmail.com?
The batch file should work on XP or 2003, 2008 etc and I be interested to get some feedback
I am in the process of writing an Umbraco help site so this (batch file) will definitely be there as it is one of the main areas of problems. I think uLess should also be there because IMHO it is the way ahead.
I have added attributions to the people who wrote the original code in the bat file. I've seen what happens if you don't!
Justin.
:( I think I spoke too soon. When I said it worked, I had written straight CSS in the .less file and that was rendering fine (browsers will read any text file as CSS as long as the type="text/css"), when I started to play with .less it wasn't so good.
I have the following simple .less code:
@Red: #f00;
.test{color:@Red;font-weight:bold}
The HTML is <p class="test">Test uLess</p>
The output is bold text but no color.
All the bits seem to be in place (dlls, web.config, UI.xml)
If you open the rendered CSS directly what does it display. It could be that the dotLess http handler is either throwing a compilation error, or that it is getting a 404 when trying to locate your .less file.
Can you post your <link> tag too?
Justin,
Opening the .less file directly in the browser showed:
But it was presented as an unknown filetype and I was prompted for what I wanted to open the file with so that tells me something.
The template including the link is:
<asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
<html>
<head>
<title>Test uLess</title>
<link rel="stylesheet" type="text/css" href="/less/Style.less" />
</head>
<body>
<umbraco:Item field="bodyText" runat="server" />
</body>
</html>
</asp:Content>
I have a feeling the problem is with IIS. I am looking into how .less is mapped to the .Net engine which is what I think is missing. 4 Guys have a bit of explanation but ony half the story on http://www.4guysfromrolla.com/articles/030310-1.aspx
Right, NOW it works. I had to add .less into the asp .Net engine. Not dead straightforward.
I expect that you have to restart IIS but I'm not sure as I restarted anyway because I was doing a re-install.
Incidentally, the reason I was doing the reinstall was that I thought I would try installing uBootstrap as I was having trouble getting uLess going. uBootstrap seemed to install but I got an http timeout error (I don't know what it was trying to do). So rather than waste time trying something that might not have fully installed I uninstalled it. Duh.
Some and only some DLLs and references are shared between UBootstrap and uLess so the site fell over as uninstalling uBootstrap deleted the DLLs but not the refs in the web.config.
Might be worth noting in your docs.
I'll add all this to my documentation.
Many thanks for your help.
The numbered bullets were removed on posting. I have a feeling this is a known (unfixed) bug, sorry about that.
Thank you for all the work fleshing out this solution. I have not used XP's IIS 6 for any umbraco work. I found that it was much easier and pain free to use IISExpress which you can get as part of WebMatrix. It has the same guts as IIS7 and will run using your current credentials, so you don't have all of the permissions issue. Another benefit is you can simply right click on any directory and choose "Open as website in WebMatrix". Now you have a local webserver open with a pretty decent IDE that even has a "Open in VS2010" button. :)
I believe that you can probably make the .less file mapping in your web.config as well. You might want to check because when you added the file mapping using the IIS manager, it probably made the change in your local web.config unless you set it at the server node level.
is working on a reply...