Copied to clipboard

Flag this post as spam?

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


  • Jeroen Oostwouder 103 posts 299 karma points
    Aug 16, 2022 @ 09:35
    Jeroen Oostwouder
    0

    Umbraco 10, Publish ignores CSS/HTML in /App_Plugins

    Hi there,

    I'm having trouble publishing a Umbraco10 site.

    When I publish my site (Delete existing files, release, net6.0, win-x64), all seems to work fine, except my App_Plugins folder.

    Only the .js and .manifest files in App_Plugins (and subfolders) are copied during a publish. The .css and .html files are ignored.

    They have a "Build Action" of "Content". What's going wrong here? A colleague with a different U10 project has the same problem.

  • Johan Runsten 38 posts 277 karma points c-trib
    Aug 16, 2022 @ 09:56
    Johan Runsten
    100

    Hi!

    As to the reason why it's not working by default I'm not sure, but to fix it try adding this to the csproj:

    <ItemGroup>    
        <Content Include="App_Plugins\**">
            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </Content>
    </ItemGroup>
    
  • Jeroen Oostwouder 103 posts 299 karma points
    Aug 16, 2022 @ 10:11
    Jeroen Oostwouder
    0

    It's weird. I opend up my .csproj file, and it had my App_Plugins folder in 2 itemgroups.

    <ItemGroup>
      <Content Include="App_Plugins\Our.Umbraco.GMaps\css\maps.css" />
      <Content Include="App_Plugins\Our.Umbraco.GMaps\lang\cs.xml" />
      <Content Include="App_Plugins\Our.Umbraco.GMaps\lang\da.xml" />
      <Content Include="App_Plugins\Our.Umbraco.GMaps\lang\de.xml" />
      <Content Include="App_Plugins\Our.Umbraco.GMaps\lang\en-gb.xml" />
      <Content Include="App_Plugins\Our.Umbraco.GMaps\lang\en-us.xml" />
      <Content Include="App_Plugins\Our.Umbraco.GMaps\lang\es.xml" />
      <Content Include="App_Plugins\Our.Umbraco.GMaps\lang\fr.xml" />
      <Content Include="App_Plugins\Our.Umbraco.GMaps\lang\he.xml" />
      ...
    </ItemGroup>
    
    <ItemGroup>
      <None Include="App_Plugins\Our.Umbraco.GMaps\js\maps.controller.js" />
      <None Include="App_Plugins\Our.Umbraco.GMaps\js\maps.factory.js" />
      <None Include="App_Plugins\Our.Umbraco.GMaps\js\snazzymaps.controller.js" />
      <None Include="App_Plugins\Our.Umbraco.GMaps\js\snazzymaps.factory.js" />
      <None Include="App_Plugins\Our.Umbraco.GMaps\package.manifest" />
      <None Include="compilerconfig.json" />
      ...
    </ItemGroup>
    

    My Media-folder is also in the first list. But it's weird that all .html and .css files are set to "Content" and are ignored on publish.

    It all gets copied if I replace all "AppPlugin" lines with your Plugins, without the need to set their "Build Action" to "None" individualy, or edit my .csproj file, right?

  • Johan Runsten 38 posts 277 karma points c-trib
    Aug 16, 2022 @ 10:55
    Johan Runsten
    1

    Those lines only specify to include these files (as you see them in your IDE), they probably default to "Copy never", so you need to either add the <CopyToOutputDirectory>Always</CopyToOutputDirectory> to your existing lines or to the whole folder as I wrote before. If so, you can remove the individual file lines!

  • Mark Bowser 273 posts 860 karma points c-trib
    Feb 27, 2024 @ 16:09
    Mark Bowser
    0

    I noticed that there are two separate App_Plugins folders in the dotnet core umbraco sites.

    • /App_Plugins
    • /wwwroot/App_Plugins

    My recommendation is to put all of your custom "App_Plugins" extensions into the /wwwroot/App_Plugins because it is an easy way to skip all the fuss about which files are and are not included in a publish. Everything I dump into /wwwroot is automatically included in the project for me.

    It seems that both of these "App_Plugins" folders are valid and both work. I'm noticing that different package creators are choosing to put their packages in different folders. For example, I'm working on a site with App_Plugins folders like this right now:

    /App_Plugins/

    • Contentment
    • DiploGodMode

    /wwwroot/App_Plugins/

    • Umbraco.BlockGridEditor.DefaultCustomViews
    • UmbracoForms
    • uSync
    • uSyncHistory
Please Sign in or register to post replies

Write your reply to:

Draft