Avoid creating uSync template files on import

I see. I might have confused myself needlessly trying to do all this with Kubernetes, uSync and Umbraco.

I mounted storage, in Kubernetes, on top of the “Views” folder, which seems to have wiped the files.
But this was of course not the case when I hosted in plain Docker, where the “Views” folder would have all my .cshtml files.

I don’t know if you reached the same conclusion in your testing, but I still have the odd behavior when importing.
If there are no physical files in the “Views” folder then uSync will import the templates, but the structure will be wrong, eg. no inheritance for Master views etc.
uSync will also mark all files as changed for every report, after the Templates are imported.
If the files are present on disk, when importing, then this does not happen and Views are imported as I would expect.

Is this in alignment with what you have found and is it just expected with the way importing .cshtml pages work?

Yeah - the structure was wrong in my testing, i think it’s only cosmetic however because the razor views does all the real inherting when they are built.

I think it’s because the Umbraco core code for working out a parent of a template now uses the actual template content to find the view (e.g it looks for the layout line in the code and parses it out, but i don’t think the code that does that actually has the contents of the template when it’s been compiled into the dll, so i guess it’s something around that.

1 Like

Cool, thanks a lot for sticking with me Kevin!

For all I can tell, it is as you write, just cosmetic(expect for the false positive, on the reports).

I guess I’ll have to accept that unless I want my view files floating around in prod, I’ll have some odd reports for the templates.