OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.38k stars 2.38k forks source link

FE theme dlls missing in custom bin folder in release build #16358

Closed bashuss closed 2 months ago

bashuss commented 3 months ago

Describe the bug

As I have two versions of my main project file in the same folder, I configured a custom build target folder (instead of 'bin') for one of these project files. This works fine for DEBUG builds, but in RELEASE the front end theme dlls are missing.

Orchard Core version

2.0.0-preview-18248

To Reproduce

Steps to reproduce the behavior:

  1. Create a full git checkout of OC
  2. Go to OrchardCore.Cms.Web project folder
  3. Copy the project file and rename it to OrchardCore.Cms.Web.Nuget
  4. Include the new project in the solution and open its property page
  5. Change output path from "bin\" to "bin-nuget\"
  6. Remove the project reference OrchardCore.Application.Cms.Targets from OrchardCore.Cms.Web.Nuget project
  7. Add nuget package OrchardCore.Application.Cms.Targets to OrchardCore.Cms.Web.Nuget project
  8. Build OrchardCore.Cms.Web.Nuget as debug and build as release
  9. Compare files in bin-nuget\Debug\net8.0\ and bin-nuget\Release\net8.0\
  10. Here the front end theme files are present in debug build, but missing in release build.

Expected behavior

theme files should be present also in the release build directory.

bashuss commented 3 months ago

Well - strange enough, after several builds confirming what I wrote, I finally have a release build folder containing the files. Still they were not shown in the admin as available themes.

After stopping the website, deleting the Release folder and starting the project again, the files were created in the new Release folder and now they are available in admin/themes.

This may be trouble with the "shared" object folder between the two project files sharing the source. But this does not explain, why the admin did not show the themes, when they were there.

I am confused.

Piedone commented 3 months ago

While I don't have an answer, I highly recommend you follow standard, simple setups, like having a separate solution/app in a separate folder for using OC from NuGet, and not mixing it with the full source.,

bashuss commented 3 months ago

Yes, I understand. Had I seen the inconsistent behavior before, I would not have posted the bug. It was reproducible like 10 times in a row, until I obviously changed something by chance. It was just my hope to have a quick setup for directly comparing behavior between source and nuget ... and then also being able to debug a problem properly. Not a good idea obviously.