Showing posts with label TDS. Show all posts
Showing posts with label TDS. Show all posts

Wednesday, 30 September 2015

Code Generation Error While Using Sitecore TDS + GlassMapper

Most of Sitecore developers are now using TDS and GlassMapper in their solution. It's an awesome combination!

But you may find some challenges when you are setting up auto code generation feature of TDS by using GlassMapper. One of such challenge is facing the code generation error as shown below.

So are you facing same error? If yes, then you are at right post.




Solution is very simple!

We found that when you download GlassHeader.tt and GlassItem.tt file, it has one extra blank line added in last line. Thanks to my colleague Mahek who helped me on this.

Remove this last blank line as suggested in below screens, and regenerate the code - you are done!



Hope this will help all those who are setting up TDS and GlassMapper in order to take advantage of auto code generation feature.

Have a Happy Sitecore Journey!

Sunday, 6 September 2015

How To Enable/Disable Code Generation For Particular Item in Sitecore TDS Project?

All of us know how to configure auto code generation in Sitecore TDS Project? It's very simple - you just need to select Enable Code Generation as shown in below figure.



But what if you want to exclude few items from this auto code generation? If you have such requirement then this post may help you.

Suppose you have configured Enable Code Generation for your Sitecore TDS project, so it will auto generate code for all of items under that project. Now if you want that some of items under that project should not be part of this auto code generation, then you can achieve it by configuring Code Generation Template property of all those items as highlighted below.


Configuring Code Generation Template as None will exclude that item from auto code generation and setting it back to blank will consider that item for auto code generation.

Thursday, 27 February 2014

Are you facing PathTooLongException while syncing with TDS in Sitecore?

Scenario:
We were using TDS smoothly in our day-to-day development life, but one day suddenly it started giving exception while syncing with Sitecore. 

We were getting below exception:
"The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. (PathTooLongException):"
 

At first glance, we thought that it could be small and temporary issue with particular sitcore item and we can solve it easily.

But it was not like that, situation was gradually becoming critical and everyone of team was facing the same issue.

So we started digging into it and obviously first question in our mind was why did it stop suddenly? Why was it working smooth previously? Did we change anything in TDS configuration?

Answer was - No. We didn't change anything in Sitecore/TDS configuration. But yes, we did a small change and that was we moved our TDS project from short path folder to long path folder. 

Do you think this could create issue? No of course not..
We were also thinking like that, but friends it was the only reason which broke TDS sync.

Reason:
As message description implies, there is problem with long file path of TDS sitecore item. TDS cannot sync with sitecore if TDS physical item path exceeds 260 characters.

How to solve it?
As per Hedgehog Development, you need to set folder alias name property to fix it.


This solution is very well explained on Hedgehog Development offical site under title of "File System Aliasing with Team Development for Sitecore" (5th video) at below link.

http://www.hhogdev.com/products/team-development-for-sitecore/videos.aspx

We became happy after seeing this solution and jumped to apply it. But unfortunately it didn't work with our environment, reason could be our TDS project is bound with SVN source-safe. We were getting "Invalid Value" message after following solution steps mentioned in above video. I am not sure why that solution was not working, we tried on few systems and everyone was facing same message.

Finally the only solution that worked was - "shorten TDS project folder path".
We moved our TDS project to near C:\ drive and it's done. But I would advise you that you should first go for "folder alias name property" and if it does not work for you like me then only go for "shorten folder path" option.

And yes, I reported this issue to Hedgehog Development support team. They replied quickly with the same solution mentioned in above video (e.g. set folder alias name property)

Friends, isn't it interesting story :)?

Facing Sitecore TDS sync issue, set folder name property/shorten TDS project path!!!