Copied to clipboard

Flag this post as spam?

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


  • Daniel Rogers 134 posts 712 karma points
    Jun 27, 2020 @ 00:58
    Daniel Rogers
    1

    uskinned v8 skin deportation to GoDaddy

    I have a uskinned v8 skin and are trying to deport it to a GoDaddy hosted site. (First umbraco 8 / uskinned site to go live)

    It wporks fine on a local machine but I get this error when live

    error CS1002: ; expected

    refering to 2 lines of code

        public string Alias => "uSkinned";
    
        public string Name => "uSkinned";
    

    the ; are there.

    C:\Windows\SysWOW64\inetsrv> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" ....
    
    
    Microsoft (R) Visual C# Compiler version 4.8.3761.0
    
    for C# 5
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    
    
    This compiler is provided as part of the Microsoft (R) .NET Framework, but only supports language versions up to C# 5, which is no longer the latest version. For compilers that support newer versions of the C# programming language, see http://go.microsoft.com/fwlink/?LinkID=533240
    
    g:\pleskvhosts\w-q-l.com.au\httpdocs\App_Code\USNBusinessLogic\USNSection.cs(7,29): error CS1002: ; expected
    g:\pleskvhosts\w-q-l.com.au\httpdocs\App_Code\USNBusinessLogic\USNSection.cs(9,28): error CS1002: ; expected
    
  • Marc Love (uSkinned.net) 432 posts 1691 karma points
    Jun 27, 2020 @ 10:44
    Marc Love (uSkinned.net)
    0

    Hi Daniel,

    You should check your web host has the minimum requirements for hosting Umbraco V8.

    https://our.umbraco.com/documentation/getting-started/setup/requirements/

    Cheers,

    Marc

  • Daniel Rogers 134 posts 712 karma points
    Jun 27, 2020 @ 22:43
    Daniel Rogers
    0

    Hosting is

    MSSQL 2014 ASP.Net 4.8.3761 iiS10

    File permissions are all set to read write create (Full Control)

    This meets all the umbraco criteria

    Put a none uskinned umbraco 8 site up and works fine.

  • Marc Love (uSkinned.net) 432 posts 1691 karma points
    Jun 28, 2020 @ 10:15
    Marc Love (uSkinned.net)
    0

    Hi Daniel,

    With our themes we provide uncompiled code within the App_Code folder so that you can make your own customisations.

    The line that is failing is:

    public string Alias => "uSkinned";
    
    public string Name => "uSkinned";
    

    This code is shorthand code syntax which was introduced with C# 6

    Your hosting server is trying to compile this code which it doesnt recognise because it is using an older version of C#

    You can change this code to the following to avoid this error:

    public string Alias
    {
        get{
             return "uskinned";
        }
    }
    
    public string Name
    {
        get{
             return "uSkinned";
        }
    }
    

    This code is found in file: ~/App_Code/USNBusinessLogic/USNSection.cs

    Cheers,

    Marc

  • Daniel Rogers 134 posts 712 karma points
    Jun 28, 2020 @ 13:47
    Daniel Rogers
    0

    Thanks Marc

    That go that solved for others the next lines that are going to cause an issue is in USNExamineEvents.cs

    I solved it like this (Marc please correct if I havent interpreted it correctly)

    _examineManager = examineManager ?? throw new ArgumentNullException(nameof(examineManager));
    _umbracoContextFactory = umbracoContextFactory ?? new ArgumentNullException(nameof(umbracoContextFactory));
    

    I changed these to

    try
                {
                    if (examineManager.GetType() != null)
                    {
                        _examineManager = examineManager;
                    }
                }
                catch { }
    

    and

            try
            {
                if (umbracoContextFactory.GetType() != null)
                {
                    _umbracoContextFactory = umbracoContextFactory;
                }
            }
            catch { }
    

    However I are having a little more difficulty with

    if (!_examineManager.TryGetIndex("ExternalIndex", out IIndex index))
                    throw new InvalidOperationException("No index found by name ExternalIndex");
    

    so far I have come up with

    try
                {
                    if (!_examineManager.TryGetIndex("ExternalIndex", out IIndex index))
                    {
                        //we need to cast because BaseIndexProvider contains the TransformingIndexValues event
                        try
                        {
                            if (!(index.GetType() == typeof(BaseIndexProvider)))
                            {
                                BaseIndexProvider indexProvider = (BaseIndexProvider)index;
                                indexProvider.TransformingIndexValues += IndexProviderTransformingIndexValues;
                            }
                        }
                        catch
                        {
                            new InvalidOperationException("Could not cast");
                        }
                    }                
                }
                catch
                {
                    new InvalidOperationException("No index found by name ExternalIndex");
                }
    

    but cant find a way round the "out"

  • Marc Love (uSkinned.net) 432 posts 1691 karma points
    Jun 29, 2020 @ 10:50
    Marc Love (uSkinned.net)
    0

    Hi Daniel,

    C# 7 allows for out parameters to be used without declaration. Before this version you need to declare the out parameter.

    Add the following above your if statement:

    IIndex index = null;
    
  • Daniel Rogers 134 posts 712 karma points
    Jun 29, 2020 @ 12:27
    Daniel Rogers
    0

    Thanks again marc

    for those that come accross this the code now looks like

    try
                {
                    IIndex index = null;
                    if (!_examineManager.TryGetIndex("ExternalIndex", out index))
                    {
                        //we need to cast because BaseIndexProvider contains the TransformingIndexValues event
                        try
                        {
                            if (!(index.GetType() == typeof(BaseIndexProvider)))
                            {
                                BaseIndexProvider indexProvider = (BaseIndexProvider)index;
                                indexProvider.TransformingIndexValues += IndexProviderTransformingIndexValues;
                            }
                        }
                        catch
                        {
                            new InvalidOperationException("Could not cast");
                        }
                    }                
                }
                catch
                {
                    new InvalidOperationException("No index found by name ExternalIndex");
                }
    

    The next question is

    Usnstyle websiteStyle = (Usnstyle)Model.WebsiteStyle;
    

    CS0246: The type or namespace name 'Usnstyle' could not be found (are you missing a using directive or an assembly reference?)

  • Marc Love (uSkinned.net) 432 posts 1691 karma points
    Jun 29, 2020 @ 12:34
    Marc Love (uSkinned.net)
    0

    uSkinned uses strongly typed models. This error indicates that your website cannot find these models. Depending on the mode you are running these can be located in different places. You may not have uploaded your models to the webserver.

    For further guidance on this see:

    https://our.umbraco.com/documentation/reference/templating/modelsbuilder/

  • Daniel Rogers 134 posts 712 karma points
    Jul 02, 2020 @ 23:51
    Daniel Rogers
    100

    I was Running in pure Live mode. But turns out that goddady is blocking this from running. I now have a class library creating a dll with the models in it.

    Also I needed to move the App_Code to its own class library.

    Doing this also meant the C#5 / 6 variations didn't matter.

    Thanks for all your help Marc

  • Marc Love (uSkinned.net) 432 posts 1691 karma points
    Jul 30, 2020 @ 09:31
    Marc Love (uSkinned.net)
    0

    Sorry, just noticed your reply. Glad to hear you got this working. Just out of interest, how is your hosting going with GoDaddy? Any speed issues running your Umbraco website?

  • Daniel Rogers 134 posts 712 karma points
    Jul 30, 2020 @ 11:30
    Daniel Rogers
    0

    Hard to say we have crap internet here anyway.

    This is the first version 8 site we have done seems to be as good as the other v7.

    9:30pm here at present speedtest is 35Mbits download and 15 upload.

    heres a link to our first umbraco v8 site.

    https://w-q-l.com.au/

    this is our own site on version 7

    https://intelligencebydesign.com.au/

    both running on godaddy hosting. with uskinned themes at there base.

    Biggest problem I have here in Australia is finding decent hosting providers. A lot of cheap options but dont offer pleask or MSSql database.

    Have now brought into the reseller plan with godaddy so kind of in there for the long haul.

Please Sign in or register to post replies

Write your reply to:

Draft