Sorting users in the Sitefinity Backend
Sitefinity has a friendly user interface for all kinds of activities. One of...
Make sure your Sitefinity embedded resources are being updated during deployment
Recently I was creating an Sitefinity MVC Widget inside an external assembly. A great way to create redistributable widgets or to separate your custom widgets from the main Sitefinity project.
One thing you need to do when working with these external assemblies, is to mark all your resources (cshtml, js, css files etc.) as embedded resources. This way they are compiled into your .dll files and can be used by your application.
The problem I run into lately was that for some reason the changes in my new version of the assembly weren't reflected in the web application. I deleted some properties and the corresponding HTML in a widget designer, but after deployment they still were there. Nothing changed.
I used .NET Reflector to examine the .dll file to see if my changes were actually deployed, which indeed was the case.
Probably a good best practice is to rebuild your external project before deploying it, but in most cases this is something that will happen when you deploy a project manually or even through a CI/CD pipeline.
After searching the internet I came across someone that actually had the same sort of problem and solved it by deleting all the caching files on the server. By default, when you compile a Web application the compiled code is placed in the Temporary ASP.NET Files folder. This folder is a subdirectory of the location where you installed the .NET framework.
I have a script that removes those files for you, in case you are interested:
Credits for this script go to an unknown Progress community member :)
Chances are that you have for some reason adjusted this line inside your web.config file:
This line contains the optimizeCompilations attribute, which specifies whether dynamic compilation will recompile an entire site if a top-level file is changed. Top-level files include the Global.asax file and all files in the Bin and App_Code folders. If set to True, only changed files are recompiled.
For me the last solution was the solving my problem. Although my .dll file was changed and was placed inside the .\bin directory, it still didn't recompile the necessary files. So, changing it to false, caused a complete recompile of my website and this resulted in all the files being updated.
Entrepreneur, Senior Software Engineer .NET, Sitefinity Solution specialist, Orchard CMS enthusiast, Product Owner
All Author PostsSitefinity has a friendly user interface for all kinds of activities. One of...
How to extend the default Image Widget in Sitefinity using a new model and an...