Copied to clipboard

Flag this post as spam?

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


  • Mikael Axel Kleinwort 140 posts 484 karma points c-trib
    Dec 23, 2022 @ 10:04
    Mikael Axel Kleinwort
    0

    uSync 11: js/css files mssing on server after publish

    Hi Kevin,

    I have a new site with Umbraco 11.0 and uSync 11. All is fine on the developer machine. When I publish to IIS, uSync's css and js files are missing and the uSync dashboard is not loading (404).

    On the developer machine, there is no uSync folder inside of AppPlugins. However, looking at browser's developer console, uSyncs css and js files are loaded (via Smidge I guess) as if they are coming from AppPlugins/uSync

    When I load the site from the server/IIS, I see 2 errors in the browser's developer console:

    LazyLoad.min.js:1          GET https://73987ni.dev.dhyanmikael.de/App_Plugins/uSync/usync.11.0.0.min.js?v=813e3b1f9d5db9c04d9afc0102dedd83a9dfb365 net::ERR_ABORTED 404
    LazyLoad.min.js:1          GET https://73987ni.dev.dhyanmikael.de/App_Plugins/uSync/usync.11.0.0.min.css?v=813e3b1f9d5db9c04d9afc0102dedd83a9dfb365 net::ERR_ABORTED 404
    

    Any idea what this is and how I get it t o work?

    Kind regards, Mikael

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Dec 23, 2022 @ 10:59
    Kevin Jump
    0

    Hi,

    Yeah it works a little different than with Umbraco7/8 which where .net framework - with .netcore the concept of 'publishing' is a little different. so I think it depends on the way you have 'published' the site to IIS.

    During development the uSync files (and many other packages depending on what you have installed) will actually coming from your local .nuget cache (usually in c:\users\username.nuget\packages).

    Asp & dotnet are doing something clever with fileproviders to make it look like those files live in your projects app_plugins folder but they don't

    with a dotnet project when you publish it (either via dotnet publish or publish in visual studio or similar) what happens is those files are copied into wwwroot/app_plugins/ - so when the site runs their the files are local.

    (you can tell if its being 'published' because a published dotnet core site has dll's in the root! , and you should see a app_plugins folder under wwwroot).

    if you "just" copy the files from a project to an IIS folder or if you point IIS at an existing folder then it usually doesn't work because the account running the IIS website can't see the .nuget cache (where the files still are).

    so -

    • For development on IIS - you need to give the account running the IIS site (usually network service) permissions to the .nuget folder under your account.
    • For published/live sites - you have to do a "dotnet publish" at somepoint to create the published version of your site - which is what you then point IIS at.

    *dotnet publish - might not be you explicity typing that, visual studio/rider do it under the hood when you 'publish' sites via their UI

  • Mikael Axel Kleinwort 140 posts 484 karma points c-trib
    Dec 23, 2022 @ 11:27
    Mikael Axel Kleinwort
    0

    Hi Kevin,

    thank you for the answer.

    The site is published to IIS (through Visual Studio Publish command). And you are right, there are some folders in AppPlugins on the server which are not there on the development machine, like "AppPlugins/UmbracoForms" etc.. They are created during publish.

    However, there is no uSync folder in App_Plugins on the server. This is the part I am not getting.

    I changed permissions on the .nuget cache folder but this make sno difference. I also uninstalled and reinstalled uSync nuget package - no difference.

    My understanding is (and that's what you confirmed) that the App_Plugin/uSync folder should be created during Publish, but for some reason, this is not happening.

    Kind regards, Mikael

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Dec 23, 2022 @ 12:10
    Kevin Jump
    0

    Hi Mikael,

    just to check what version do you have installed, this is all working locally for me.

    also are you looking in wwwroot/appplugins or just apppluigns.

    after publish there is still a apppluigins in the root, but there is another wwwroot/appplugins, which is where the published files from packages like usync will be getting placed.

  • Mikael Axel Kleinwort 140 posts 484 karma points c-trib
    Dec 23, 2022 @ 13:03
    Mikael Axel Kleinwort
    0

    Hi Kevin,

    I found the cause of the issue.

    I had excluded the /uSync import/export folder with the following skip directive:

    <MsDeploySkipRules Include="CustomSkipFolder">
        <ObjectName>dirPath</ObjectName>
        <AbsolutePath>uSync</AbsolutePath>
    </MsDeploySkipRules>
    

    However, this also skipped the uSync folder in App_Plugins. Removing the directive solved the problem.

    Kind regards, Mikael

  • Mikael Axel Kleinwort 140 posts 484 karma points c-trib
    Dec 23, 2022 @ 13:04
    Mikael Axel Kleinwort
    0

    Hi Kevin,

    I sorted it out, see my reply above. Thank you for responding, and sorry for wasting your time on an issue which was caused by something entirely different.

    Kind regards, Mikael

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    Dec 23, 2022 @ 14:10
    Kevin Jump
    0

    No worries,

    Its good you found (and shared) the problem, if someone else has a similar problem there is an answer now 👍

Please Sign in or register to post replies

Write your reply to:

Draft