Sitefinity Embedded Resources Not Refreshed During Deployment
When deploying updated Sitefinity MVC widgets from an external assembly, sometimes the embedded resources don’t refresh — even when the new DLL is deployed. Here’s what causes this issue and how to fix it.

The Problem
Recently, I was creating a Sitefinity MVC widget inside an external assembly — a great way to build reusable widgets or keep custom widgets separate from the main Sitefinity project.
When working with external assemblies, you need to mark your resources — such as .cshtml
, .js
, and .css
files — as embedded resources. This ensures they’re compiled into your DLL and accessible by your Sitefinity application.
However, I ran into a strange issue:
After deploying a new version of my assembly, my changes weren’t showing up in the web application. Even though I had removed some properties and the corresponding HTML in the widget designer, the old version kept appearing.
To verify that my DLL was updated, I inspected it with .NET Reflector, and indeed, the changes were present. So why wasn’t Sitefinity picking them up?
Solution 1: Rebuild and Clean Your Project
As a general best practice, always rebuild your external project before deploying. This ensures that your latest resources are embedded and compiled correctly.
If you’re deploying manually or through a CI/CD pipeline, this usually happens automatically. Still, it’s good to confirm that no stale build artifacts remain before pushing your code.
Solution 2: Manually Remove Cached Files
After searching online, I discovered that other developers had experienced similar issues — and the culprit was server-side caching.
By default, when you compile an ASP.NET web application, the compiled output is stored in the Temporary ASP.NET Files folder, located inside your .NET Framework installation directory.
If this cache isn’t cleared, the web application may continue to serve old compiled versions of your resources.
You can fix this by manually deleting the contents of that folder.
If you frequently deploy new assemblies, consider creating a cleanup script that removes these files automatically. It can save a lot of time (and head-scratching) during deployments.
@ECHO OFF
cls
Title IISRESET - CLEAN
ECHO ======================================================================
ECHO Performing IIS Reset and Clean
ECHO ======================================================================
ECHO.
ECHO STOPPING IIS...
IISRESET /STOP
ECHO.
ECHO DELETING ASP.NET CACHE...
Del /F /Q /S %LOCALAPPDATA%\Microsoft\WebsiteCache\*.*
Del /F /Q /S %LOCALAPPDATA%\Temp\VWDWebCache\*.*
Del /F /Q /S "%LOCALAPPDATA%\Microsoft\Team Foundation\3.0\Cache\*.*"
Del /F /Q /S "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\*.*"
Del /F /Q /S "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\*.*"
Del /F /Q /S "C:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\*.*"
Del /F /Q /S "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\*.*"
ECHO.
ECHO STARTING IIS...
IISRESET /START
ECHO.
ECHO COMPLETE
ECHO.
ECHO ======================================================================
ECHO.
pause
Solution 3: Check the optimizeCompilations
Setting in web.config
Another potential cause lies in your web.config
.
Look for this line:
<compilation debug="false" optimizeCompilations="true" targetFramework="4.8" />
The optimizeCompilations
attribute controls whether dynamic compilation recompiles the entire site when top-level files (like those in the Bin
or App_Code
folders) change.
- When set to true, only changed files are recompiled.
- When set to false, the entire site is recompiled when something changes.
If your DLL has changed but Sitefinity still uses cached resources, try setting optimizeCompilations="false"
.
This forces a full recompile of the site and ensures that all embedded resources are refreshed.
Conclusion
In my case, adjusting the optimizeCompilations
setting finally solved the problem.
Even though my updated DLL was in the .\bin
directory, Sitefinity didn’t recompile everything automatically. After setting optimizeCompilations
to false
, the application performed a complete recompile — and my updated embedded resources appeared as expected.
If you ever find yourself wondering why your latest embedded resources don’t show up after deployment, check these three things first. It might save you a few hours of frustration.
I offer hands-on consulting to help you resolve technical challenges and improve your CMS implementations.
Get in touch if you'd like support diagnosing or upgrading your setup with confidence.