Copied to clipboard

Flag this post as spam?

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


  • Stewart Ellis 25 posts 64 karma points
    Aug 02, 2011 @ 18:10
    Stewart Ellis
    0

    Ent Lib causing all xslt macros to fail in 4.7

    Quick background

    I've been developing a site that will be consuming a great deal of data that will live outside of umbraco. The "3rd-party" data resides in a separate Sql Server Database. It's my intention to access all the data via the EntLib 4 Data Access Application Block, as all the code has already been written and deployed for a number of years. As such, I've copied over all the required DLLs, including the DLL for my user controls. I've also made the required entries in the web.config file. Everything is working and just fine and I'm pulling in the third-party data, except:

    All xslt files now fail.

    I understand that umbraco used to use EntLib itself. Does this have something to do with that? The error says that I'm missing Microsoft.Practices.Unity, but my code does not use that library at all.

    Any insights would be welcome.

    Thanks

     

    Here is the error message I'm getting:

     

    Error parsing the XSLT:

    System.Exception: Unable to load one or more of the types in assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'. Exceptions were thrown: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.Unity, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at umbraco.BusinessLogic.Utils.TypeFinder.FindClassesMarkedWithAttribute(Assembly assembly, Type attribute) at umbraco.BusinessLogic.Utils.TypeFinder.FindClassesMarkedWithAttribute(Type attribute) at umbraco.macro.GetXsltExtensionsImpl() at umbraco.cms.businesslogic.cache.Cache.GetCacheItem[TT](String cacheKey, Object syncLock, CacheItemPriority priority, CacheItemRemovedCallback refreshAction, CacheDependency cacheDependency, TimeSpan timeout, GetCacheItemDelegate`1 getCacheItem) at umbraco.macro.GetXsltExtensions() at umbraco.macro.AddMacroXsltExtensions() at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.presentation.umbraco.developer.Xslt.xsltVisualize.visualizeDo_Click(Object sender, EventArgs e)

     

  • Stewart Ellis 25 posts 64 karma points
    Aug 02, 2011 @ 22:42
    Stewart Ellis
    0

    RESOLVED!

  • Nicolai Winch Kristensen 50 posts 70 karma points
    Sep 27, 2011 @ 13:01
    Nicolai Winch Kristensen
    0

    Hi Stewart

    Im having Exact same problem and scenario with EnterpriseLibrary and Umbraco trying to create a 3rd aprty control that are using separate DB and EntrpirseLibrary.

    Any help og  hints on how you solved it, would really be highly appriciated :-)

    :-) Nicolai

  • Stewart Ellis 25 posts 64 karma points
    Sep 29, 2011 @ 19:52
    Stewart Ellis
    0

    Hey Nicolai, I put "resolved" in this posting for house keeping purposes, but it truth I kinda went around the problem, instead of resolving it. After spending a pile of time on it, I ended up ditching EntLib and wrote some plain old ADO.NET code instead (which worked fine by the way). At the end of the day, it was only a handfull of SELECT queries I need to execute, so it seemed like a simple solution.

    Sorry I can offer better answer. 

  • Nicolai Winch Kristensen 50 posts 70 karma points
    Sep 30, 2011 @ 09:58
    Nicolai Winch Kristensen
    0

    Hi Stewart

    Thx for your reply - I actully thought about same workaround, but I actually managed to get it working with Enterpise Library:

    actually it was pretty straight forward - but isnt it always like this when you find the solution ;-)

    So just in case for the future, or if somenone else runs into the same problem. - heres what I did.:

    - if you go to umbraco and saves a xslt, you will see you get an error saying it cant find other DLLs in the Ent Lib (in stewarts case EntLib.common.dll - se above)

    - so the solution is pretty simple: add the remaining dll's from the ent lib to the bin folder. You can try and do it step by step, and add the dll its asking for. and when the full library is there, it will work again.

    - since I was in the same situation as stewart, where I had working code in a separate project only using a couple of the Ent Libs DLLs , which also was older versions , I downloaded latest version of Enterpirse Library, uploaded it to my working projekt and changed references to the new versions, and made it work with them.

    - after that I copied full ent. lib to the umbraco bin also.

    - an voila! both xslt and my controls now worked. So conclusion must be: upgrade to newset version, and add the full enterprise library. :-)

    NB! what I cant explain though, is why my own project worked with only a couple of the DLLs , but umbraco thows errors, tellin it needs the remaining dlls ? 

    Best regards

    Nicolai

     

  • Stewart Ellis 25 posts 64 karma points
    Oct 02, 2011 @ 18:10
    Stewart Ellis
    0

    Well done!

    Re: needing the full ent Lib library, makes you wonder if some of the source from Ent Lib is lurking in umbraco somewhere

    cheers

Please Sign in or register to post replies

Write your reply to:

Draft