Copied to clipboard

Flag this post as spam?

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


  • Dee 118 posts 338 karma points
    Oct 25, 2020 @ 10:31
    Dee
    0

    Change Umbraco Path vs. Rebuilding the Solution

    Hi!

    I have successfully changed the umbraco path by renaming the umbraco folder and changing the web.config entries:

    <add key="Umbraco.Core.ReservedPaths" value="~/newpath" />
    <add key="Umbraco.Core.Path" value="~/newpath" />
    

    However, everytime I rebuild the solution in VS, the umbraco folder returns, although the pathing now goes through the new path, I am wondering why rebuilding the solution recreates the umbraco folder and many files within it and if this should be this way?

    Am I missing any additional things and changes?

    Thanks

    Dee

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Oct 25, 2020 @ 10:35
    Marc Goodson
    0

    Hi Dee

    Did you install Umbraco with Nuget? and do you have 'restore Nuget Packages' on build option enabled in Visual Studio.

    The Nuget package won't know about your decision to change the folder name, and so I think would see the /Umbraco folder as missing and restore?

    regards

    Marc

  • Dee 118 posts 338 karma points
    Oct 25, 2020 @ 11:33
    Dee
    0

    Hey Marc,

    thanks for your response.

    It is an Umbraco Cloud solution, but I did a Nuget downgrade after the last upgrade from 8.8 back to 8.7, because of some bugs in 8.8.

    So it should be now a nuget installation.

    Regarding the "restore Nuget Packages" on build options, where do I find this?

    Do you mean the file UmbracoCms.targets in ~\packages\UmbracoCms.8.7.0\build?

    There I found this entry: enter image description here

    is this causing the issue?

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Oct 25, 2020 @ 12:13
    Marc Goodson
    0

    Hi Dee

    I was thinking of this setting:

    https://docs.microsoft.com/en-us/nuget/consume-packages/media/restore-01-autorestoreoptions.png

    but yes, I think if Nuget tries to restore the Umbraco package, then it might recreate those folders?

    The targets file I think is saying 'include these folders' when you deploy, so you don't have to include them in the Visual Studio project,

    In the past there has always been lots of things that rely on the /umbraco folder from being present - particulary 3rd party packages - it's got much better recently, but I still tend not to rename the Umbraco folder but use IIS rewrite rules to protect its existence from the outside world...

    https://our.umbraco.com/documentation/reference/security/Security-hardening/#lock-down-access-to-your-umbraco-folders

    There is some suggestion in the Umbraco Documentation that changing the Umbraco folder on Umbraco Cloud is unsupported - https://our.umbraco.com/Documentation/Reference/Security/Security-hardening/#rename-your-umbraco-folder - but that might be out of date?

    regards

    Marc

  • Dee 118 posts 338 karma points
    Oct 25, 2020 @ 12:36
    Dee
    0

    Big thanks mate!

    I do feel very uncomfortable renaming the umbraco folder, because of many dependencies and further upgrades, applied from the umbraco cloud.

    So I will rather go for the first approach you suggested.

    Best

Please Sign in or register to post replies

Write your reply to:

Draft