1

I've added 4 new fields under /Sitecore/Templates.

Just to confirm, are my following assumptions correct? I feel I'm closing in from experiments alone, but among so many things to know and read about, I won't mind some external light.

  • in Visual Studio 2013, until you do a TDS "Sync with Sitecore" there is no awareness of these new fields.

  • You normally never have to manually edit GlassData.cs . After a TDS "Sync with Sitecore", the 4 new fields would be added automatically there, on the next Visual Studio BUILD. (At first, I manually added my 4 fields there.. until I could Build quietly)

  • GIT / bitbucket : you normally never include GlassData.cs in a commit. In effect you never "Push" GlassData.cs? But then what would be the auto-refresh mechanism on a shared DEV Sitecore instance (no Visual studio there) ?

Thank you!

1 Answer 1

4

The code generated model file (your GlassData.cs file) will regenerate when you sync with Sitecore. It will have no awareness of any items that are not in the TDS project. Your new fields will only be added to the generated code models after the Sitecore Sync.

The generated file should not be manually modified as the next sync will overwrite the changes. You should create new partials of the classes if you want to add any additional fields or properties to the models.

You will want to check in the generated file into your source control system.

2
  • Super, this is really helpful, so all is happening at TDS sync and not VS Build or other unknown behind-the-scene mechanism as I thought. And then I do have to check GlassData.cs in (and will!).. Patrick, thanks a ton! Jun 7, 2018 at 16:14
  • OK - we have a fairly large GlassData.cs, and the Bitbuket "diff" of my Pull Request failed with this message: "Now that is a lot of code! There's simply too much in this diff for us to render it all." And Bitbucket flags it as "Conflict" while the modification was straightforward ( 4 new fields.. ). I think it's just a side-effect of the aborted "Diff". Jun 11, 2018 at 21:20

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.