Copied to clipboard

Flag this post as spam?

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


  • Torleif 11 posts 68 karma points
    Mar 23, 2015 @ 15:45
    Torleif
    0

    Cannot resolve DittoPublishedContentModelFactory

    Hi!

    I’m trying to use Ditto 0.6.1 but can’t resolve the custom model factory (DittoPublishedContentModelFactory).

    Is anyone else having this problem or did I overlook something? 

    Installation through nuget.

    I used version 0.4.1 in another solution and this works fine.

    Umbraco 7.1.8

    Using version 0.4.1 for now. 

    Any help is much appreciated :) 

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Mar 23, 2015 @ 15:54
    Lee Kelleher
    101

    Hi Torleif,

    The DittoPublishedContentModelFactory has been moved out of the core Ditto project, the reasons for this are:

    • We can support Umbraco v6.x, (the model-factory was introduced in v7.1.4)
    • and that there is a fundamental issue with recursive POCO references - which were difficult to fix/support.

    The codebase for the model factory is still available here: https://github.com/leekelleher/umbraco-ditto/tree/master/src/Our.Umbraco.Ditto.ModelFactory

    You'll need to build it manually, then drop the Our.Umbraco.Ditto.ModelFactory.dll into your /bin folder.

    I'm planning on adding a NuGet package for this soon - just need to schedule it in. (I'm juggling a lot of community package support these days!)

    Cheers,
    - Lee

  • Torleif 11 posts 68 karma points
    Mar 23, 2015 @ 16:41
    Torleif
    0

    I totally understand Lee. Great work on the package!

    Cheers,
    Torleif 

  • Keith R Hubbard 175 posts 403 karma points
    May 21, 2015 @ 08:04
    Keith R Hubbard
    0

    I am getting the name factory does not exist in the current context.  I followed your video and added references to my project and added the DittoPublishedContentModelFactory DLL. The AppStartup.cs is in the AppCode folder and should work. What am i missing?

     

     

    AppStartup.cs

    namespace itmediastudio.com.App_Code

    {

        public class AppStartup : ApplicationEventHandler

        {

            protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)

            {

                var types = PluginManager.Current.ResolveTypes();

                var Factory = new DittoPublishedContentModelFactory(types);

                PublishedContentModelFactoryResolver.Current.SetFactory(factory);

     

            }

        }

    }

    any input would be halpful.

    thanks Keith

  • Torleif 11 posts 68 karma points
    May 21, 2015 @ 10:28
    Torleif
    1

    I would try changing the local factory variable to "factory" without the capital letter :)

    var types = PluginManager.Current.ResolveTypes<PublishedContentModel>();

    var factory = new DittoPublishedContentModelFactory(types);

    PublishedContentModelFactoryResolver.Current.SetFactory(factory);

  • Keith R Hubbard 175 posts 403 karma points
    May 21, 2015 @ 20:39
    Keith R Hubbard
    0

    that fixed it thank you

Please Sign in or register to post replies

Write your reply to:

Draft