Check your code with Unicorn serialized data

Posted by Robin Hermanussen on January 26, 2017 · 2 mins read

I was looking into Roslyn recently and figured that it would be useful for checking whether Sitecore ID’s and paths that are used in code are correct or not. I wanted it to check this with the Unicorn serialized data that I have.

That’s why I created an analyzer that does just that. I’m curious to get some feedback on it so I can improve things.

Integrate this into your build using NuGet or use the Visual Studio Gallery to install the extension. Get more info and the source on GitHub (the main page contains installation instructions).

Update: field names and ID’s are now also supported.

Update 2: field names and ID’s can now also be validated against a template.

Update 3: a tooltip will now be displayed for ID’s, to show the full path of the item. Similarly, a tooltip will be displayed for paths to show the ID.

Update 4: fields that are decorated with Glass Mapper attributes can now also be validated against a template.Field on template checking for Glass Mapper