Copied to clipboard

Flag this post as spam?

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


  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Jan 12, 2017 @ 14:30
    Bjarne Fyrstenborg
    0

    Extension method GetResponsiveImageUrl is not found

    I have an existing project, which use Slimsy and the extension method GetResponsiveImageUrl on IPublishedContent.

    I have cloned a new project on Umbraco Cloud running Umbraco 7.5.7 and the merged the stuff to the Umbraco Cloud project.

    However in the partials, where it use GetResponsiveImageUrl is doesn't seem to recognize it.

    The original partial:

    enter image description here

    The Umbraco Cloud project:

    enter image description here

    It works if I add @using Slimsy; to the file.

    /Bin folder contains both Slimsy.dll and Slimsy.dll. Furthermore web.config has the following:

    <httpModules>    
    <add name="SlimResponseModule" type="Imazen.SlimResponse.SlimResponseModule, Imazen.SlimResponse" />
    </httpModules>
    

    and

    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true">
          <add name="SlimResponseModule" type="Imazen.SlimResponse.SlimResponseModule, Imazen.SlimResponse" />
        </modules>
    </system.webServer>
    

    /Bjarne

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jan 12, 2017 @ 16:45
    Jeavon Leopold
    1

    Hi Bjarne,

    The namespace must have been removed from the web.config within the Views folder.

    The namespaces element should include:

        <add namespace="Slimsy" />
    

    Thanks,

    Jeavon

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Jan 12, 2017 @ 17:07
    Bjarne Fyrstenborg
    0

    Hi Jeavon

    I thought about that too, but it does exists here in /Views/Web.config:

    <system.web.webPages.razor>
        <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <pages pageBaseType="System.Web.Mvc.WebViewPage">
          <namespaces>
            <add namespace="System.Web.Mvc"/>
            <add namespace="System.Web.Mvc.Ajax"/>
            <add namespace="System.Web.Mvc.Html"/>
            <add namespace="System.Web.Routing"/>
            <add namespace="Umbraco.Web"/>
            <add namespace="Umbraco.Core"/>
            <add namespace="Umbraco.Core.Models"/>
            <add namespace="Umbraco.Web.Mvc"/>
            <add namespace="umbraco"/>
            <add namespace="Examine"/>
                <add namespace="Umbraco.Web.PublishedContentModels"/>
                <add namespace="Slimsy"/>        
          </namespaces>
        </pages>
      </system.web.webPages.razor>
    

    The original project has been upgraded from Umbraco 7.4.1 to 7.5.7 .. where it works.

    Then I have cloned a new clean project from Umbraco Cloud and merged the stuff to the cloud project.

    I have compared the files in both projects and can't find any difference regarding Slimsy.

    Could it somehow conflict with Courier?

    /Bjarne

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Jan 12, 2017 @ 17:17
    Bjarne Fyrstenborg
    100

    Hmm, now it seems to work.

    I think it was because I touched the ~/Views/Web.config file or restarted Visual Studio.

    /Bjarne

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jan 12, 2017 @ 17:30
    Jeavon Leopold
    0

    Strange, not unless something in Umbraco Cloud is reverting that change to /Views/Web.config.

    You could try adding it to the main Web.Config but this relates to the Views, so that specific Web.Config is the right place for it.

    I'm assuming it doesn't work on your local dev machine as well as on Umbraco Cloud?

  • Bjarne Fyrstenborg 1285 posts 4039 karma points MVP 8x c-trib
    Jan 12, 2017 @ 17:41
    Bjarne Fyrstenborg
    0

    I doesn't work on my local machine now.

    I guess the razor/view engine somehow didn't see the changed merged, which maybe first happened after I touched the Web.config i Views folder or restarted VS.

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Jan 12, 2017 @ 17:47
    Jeavon Leopold
    0

    Sounds like a issue with your ASP.NET Temp files not getting updated correctly.

    Remove everything from

    %AppData%\Local\Temp\Temporary ASP.NET Files
    

    and/or

    C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files
    
Please Sign in or register to post replies

Write your reply to:

Draft