We have installed the razor mediator, and are now testing to see if we can save a Razor template building block. When saving a TBB we got the following message:
Attempting to create Session - razor config attribute 'adminUser' is required to use this feature Unable to save Template Building Block (tcm:0-0-0)
We attempted a quick fix by simply configuring an admin user, but to get that working will require that we configure impersonation. (Which might be worth considering, but that's not what this question is about.)
The question is: why doesn't this work when we have no imports configured? The documentation says it shouldn't be necessary. I've just had a quick look at the code, and GetImportTemplateContent(), seems to be the only place that creates a Session. This in turn is only called by ImportIncludes(), which only calls it if an include is found in the configuration or in the content. I don't have the opportunity right now to get this under a debugger, so any insights would be welcomed.
Edit: Would there be any downside in having the Session property simply use the other overload of Tridion's Session constructor if no admin were configured?