Saturday, 21 November 2015

FIXED: Umbraco - Error loading MacroEngine Script

I have just had to go through the task of migrating a legacy Umbraco 4 site across to new web space.  

The site was a simple enough copy along with a backup and restore of the MySQL database. However when I came to run the website I got the message "Error loading MacroEngine Script (file:...)"

After a bit of digging I found two useful things; one to help with debugging and another to address the actual issue mentioned above. 

Assist with debugging

Within Ummbraco (prior to version 7 I believe) if you want to debug any issues you can update the following line within the web.config:



Once you have done this you can visit your problematic page with the following URL parameter on the end "?umbDebugShowTrace=true" and it will output trace information that may highlight any issues:



The issue that it actually highlighted was "There is no Lucene index in the folder..."

Fixing the issue

No after a little more digging this was simply resolved by going in to the App_Data folder within my site and emptying out all the folders within "TEMP/ExamineIndexes".  So I was left with the following empty folders beneath ExamineIndexes:



Tuesday, 17 February 2015

FIXED: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

I had this issue crop up while supporting an old website that when I came to publish the website in both Visual Studio 2012 and 2013 I would get the following error:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.







After trying to set the "Target Location" setting here to a shortened path of "c:\wd" I still had the issue:




After some digging around I found that the fix was in the following file:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets

I changed:

<AspnetCompileMergeIntermediateOutputPath Condition="'$(AspnetCompileMergeIntermediateOutputPath)' == ''">$(IntermediateOutputPath)AspnetCompileMerge\</AspnetCompileMergeIntermediateOutputPath>

to 

 <AspnetCompileMergeIntermediateOutputPath Condition="'$(AspnetCompileMergeIntermediateOutputPath)' == ''">c:\sp\</AspnetCompileMergeIntermediateOutputPath>

The build then completed as expected