admin project not always publishing

I have an admin project and it is set up and works locally, and i even have it working on our staging server, but when i make updates to the admin project, it doesn't seem to get updated when i publish the site. I have to go and clean and rebuild and publish and clean and rebuild and publish over and over and eventually it works. Is there a process to this that i am missing?

it's set up in the the solution and I believe connected properly as per the documentation, but updating seems to never work.


Environment

  • Xperience by Kentico version: [31.3.0]

  • .NET version: [8]

  • Execution environment: [SaaS|Private cloud (Azure/AWS/Virtual machine)]

  • Link to relevant Xperience by Kentico documentation

Answers

Care to share any of your project details or code? In general, sharing this additional information makes it significantly easier for people to assist you.

i even have it working on our staging server, but when i make updates to the admin project, it doesn't seem to get updated when i publish the site

I assume you have a dedicated Xperience "Admin" project in your .NET solution to extend the Xperience administration. Are you saying:

  1. These administration behavior and UI extensions work in your staging environment, but don't work in another environment?
  2. You actually have the source code running in your staging environment using dotnet run but you are building and publishing the application to another environment where you use dotnet MyApp.dll to run the application?

I have to go and clean and rebuild and publish and clean and rebuild and publish over and over and eventually it works.

I think you are missing some fundamentals about .NET and ASP.NET Core applications that are not unique to Xperience by Kentico.

We cover deployments to private cloud (e.g. your own servers) in our documentation.

When you run dotnet publish it builds the application and creates an output artifact containing only .dlls files and static artifacts (ex: client assets and images).

This publish output (or at least the .dll files) needs to completely replace the files you have running on your server. This means stopping the application in IIS (or Azure App Service), replacing the files, and then starting the application again.

You need to run additional commands to apply updates to content and object types, or apply a hotfix or Refresh to your deployed application.

There are plenty of ways to eliminate the downtime you experience during a deployment, like Xperience by Kentico SaaS. But you can also use your own load balancing or Azure App Service deployment slots combined with Xperience readonly deployments.

If you want to see deployment automation for an Xperience by Kentico SaaS project, the Kentico Community Portal's GitHub workflow is open source.

Which files are the most relevant to share? This could be my misunderstanding of how you are supposed to publish the site, but the site works and the custom admin also works (locally and on staging). And, just to be clear, when i say update, i don't mean run a Kentico update or hotfix, I mean when I make changes to my code.

The issue that I seem to be running into is when I publish the site the web admin dll doesn't seem to always update in the publish folder. For example, if I make a change to a TSX file that i have built for a form control, I can get it to run locally with the webpack set up. I test and make sure the changes work as needed, but when I then publish the site to push out the changes, in my publish folder the webadmin.dll doesn't get updated.

So i guess my real question is, what is the proper process to push out the web admin files. Do I need to publish it separately and push them out from that location, or am i missing something that has it push out the when i publish my main site.

Hope this all makes sense.

when I publish the site the web admin dll doesn't seem to always update in the publish folder

dotnet publish will always build the app and copy all dependent .dll files and other assets into the publish output directory.

Unless you have some some C# preprocessor directives that exclude certain code blocks, files, or project/library references based on environment or build command properties, any code referenced locally will be deployed.

when I then publish the site to push out the changes, in my publish folder the webadmin.dll doesn't get updated

This isn't an issue with Xperience by Kentico. The "admin" project is just a .NET project. Yes, the admin client assets (npm packages, custom React components, CSS files) are all bundled into the .dll, but if it isn't copied into your dotnet publish output directory, you have something misconfigured or you are running a command incorrectly.

what is the proper process to push out the web admin files

There is no special process. dotnet publish (without extra flags like --no-build) will build the project in Release mode and copy all dependent .dll files into the output directory.

Have you tried using the Dancing Goat project template and the related Admin project template?

If you cannot reproduce the behavior you are seeing (your admin .dll isn't in the publish output directory) with Dancing Goat, then the issue has to be with your project configuration or publish command.

To response this discussion, you have to login first.