Right now it seems that the razor imports get cached, and you need to "touch" (make a minor change) to the TBB that is using the razor import.

This usually isnt a problem unless of course you're using the import on a handful of other TBBs, requiring you to go "touch" all of them.

Is there a way to use the latest version of the imports automatically get the latest version of the razor and not require the "touch".

The closest thing I could find about this was on this question. Embedded Razor Templates

1 Answer 1


What I didn't explain in the answer to Embedded Razor Templates was the reason why. What's happening is that the templates get compiled dynamically, and the resulting type is loaded in the appDomain. If you create a new version of a template building block, the includes are resolved as a simple text include and become part of the resulting type. The mediator tracks the relation with the TBB, but not the imports. If I remember correctly, this tracking logic was more sophisticated in previous versions, but this was a casualty of having to fix a memory leak.

It's known that the current architecture has its weaknesses, and that the next version of the mediator ought probably to be a re-write with some architectural improvements, such as programmatic management of application domains so that the types representing earlier TBB versions can be unloaded.

Alex Klock mentions here that the main focus is now on version 2.0, but that there may possibly be a version 1.4. So if you really want a solution, one option is to get in touch with Alex and volunteer to help. If you can solve the problem on the current architecture, then a pull request would probably work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.