Copied to clipboard

Flag this post as spam?

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


  • Damion Daly 5 posts 85 karma points
    1 week ago
    Damion Daly
    0

    Issue with NewsletterStudio.Api in the NewsletterStudioSubscribe.cshtml, in an Umbraco 8 site

    I have just inherited on old Umbraco 8 site which uses NewsletterStudio and has the following nuget packages installed:

    NewsletterStudio 3.0.9
    NewsletterStudio.Core 3.0.9 NewsletterStudio.Web 3.0.9

    On trying to get the site to build, the 1st issue I have is with the NewsletterStudioSubscribe.cshtml, any line using, NewsletterStudio.Api, eg

    if (NewsletterStudio.Api.IsValidEmail(txtEmail))
    

    show a red line under it with the error,

    'Api' does not exist in the namespace 'NewsletterStudio'

    As far as I can tell this view is provided as a template and hasn't been touched. Am I missing something else I need to install?

  • Markus Johansson 1945 posts 5896 karma points MVP 2x c-trib
    1 week ago
    Markus Johansson
    1

    Hi!

    It looks like some kind of old macro, this method existed in v2 but was removed and moved into the INewsletterStudioService in v3 and above.

    // Markus

  • Damion Daly 5 posts 85 karma points
    1 week ago
    Damion Daly
    0

    Ah ok makes sense, thanks. I also noticed errors relating to missing code-behind files for aspx pages in \App_Plugins\NewsletterStudio\Pages, but as all I have is what I've been handed I'm unsure if these should actually be here, any comment on that?

    Thanks again

  • Markus Johansson 1945 posts 5896 karma points MVP 2x c-trib
    1 week ago
    Markus Johansson
    100

    Hi!

    Modern versions of the package (Umbraco 8 and above) should not have any aspx files - maybe the site was upgraded from an earlier version of Umbraco? Sounds like it was and that any old legacy files for the package was left and not cleaned up during the migration/upgrade.

    If you are on 3.0.9 it should be safe to remove these aspx-files.

    // Markus

  • Damion Daly 5 posts 85 karma points
    1 week ago
    Damion Daly
    0

    Thanks again, most helpful!

  • Markus Johansson 1945 posts 5896 karma points MVP 2x c-trib
    1 week ago
    Markus Johansson
    0

    Hi!

    More than happy to help, always feel free to reach out if you have questions, issues or feedback.

    Cheers!

  • Damion Daly 5 posts 85 karma points
    1 week ago
    Damion Daly
    0

    One last thing if you don't mind me asking, when building the site now I get a load of these errors

    BeginContext("~/App_Plugins/NewsletterStudio/Themes/Default/Views/Controls/Button.cshtml", 259, 4, true);

    WriteLiteral("\r\n\r\n");

    EndContext("~/App_Plugins/NewsletterStudio/Themes/Default/Views/Controls/Button.cshtml", 259, 4, true);

    They are all related to NewsletterStudio views. I have updated the Newsletter packages to 3.0.18 and have the up-to-date Microsoft.Aspnet.Mvc and Microsoft.Aspnet.razor packages for the version on .NET it's running. All other errors I had before are gone so I'm hoping this is the last hurdle, any info you have appreciated.

    Thanks again.

  • Markus Johansson 1945 posts 5896 karma points MVP 2x c-trib
    1 week ago
    Markus Johansson
    1

    Hi!

    This looks like an error from the "modern" version of the package. I have never seen this before, it looks like you're trying to compile the build in views which you should not do.

    Look for settings around compiling the views and try to exclude anything from our package from this.

    // Markus

Please Sign in or register to post replies

Write your reply to:

Draft