(**Note: This might be little pre mature, but I want to capture the main process of the solution before I forget.)
I have created a Sitecore project using Helix Principle. For all the TDS projects I have created a Global TDS config and that is the easiest way to handle the TDS items. We are using a local VM that doesn’t have no internet access. But our host machine has internet access. We map our VM drive to a drive letter on the host machine. For example “x” drive might be pointing to VM’s c:\inetpub\mysite\Website. This works great while doing the local development and keeps our security people happy.
Now with the Helix, we want to implement our CI, everytime a developer check in code to the main branch. Our build server doesn’t have any network connectivity, so All the nuget packages has to be supplied through source control. That’s fine. But problem is, I am pointing my local TDSGlobal.config to <SitecoreWebUrl>[VM website address like http://192.xxx.xxx.xxx]</SitecoreWebUrl> and <SitecoreDeployFolder>[Network path like \\192.xxx.xxx.xxx\mysite\website]</SitecoreDeployFolder>. These paths are obviously invalid for the build server and it keeps on trying to copy files to a non existing location. Build breaks!
My issues
a. TDSConfig path
b. I have a xxx….afterbuild file that was also breaking for same reason
c. HedgeHog sitecore target files are not found . So TDS complaining about Build Target.(this solves the problem “Error MSB4057: The target “Build” does not exist in the project”.
Solution
- Fix the TDSConfig path
- There should be 2 propertyGroup on TDSGlobal config.
- Debug Condition
- All the specific items should go here
- Release
- Should have nothing at this point (for me, your situation might be different)
- Debug Condition
- There should be 2 propertyGroup on TDSGlobal config.
- Remove the solution afterbuild and common.props (for now, I will update this soon)
- go to your C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0 and grab all the files and create a new folder at solution level called (whatever you want) Hedgehog and put all the files in that folder.
- Open the HedgehogDevelopment.Sitecore.Project.Targets and Search for HedgeHogDevelopment.SitecoreProject.Tasks.dll and and remove “$(MsBuildThisFileDirectory)” segment and leave everything else.
- Search for TDSService.asmx and change to <Copy SourceFiles=”TDSService.asmx” Destination files=[keep this as it is ] /> This will be actually take out some of the “$(MsBuildThisFileDirectory)” segment .
- Search for for all *.scproj files from your root folder. (You can do this part using unload project and editing file).
- At the bottom you will find a import statement for the hedgehog delete it and replace it with
- <Import Project=”..\..\..\..\Hedgehog\HedgehogDevelopment.Sitecore.targets” />
- Save all.
- Change the project to release and check in.
- If your CI is not setup to automatically watch the main branch, manually queue a build.
- Watch it turn green 🙂
This was a very quick blog, so I don’t forget what the issue was and how I solved it. I will come back and update this soon.
I have to give my shout out to the following blogs for giving me the helping hand. Thank you.
http://sitecoreblog.patrickperrone.com/2015/05/msbuild-and-tds.html
http://www.glass.lu/Blog/Archive/Working%20with%20TDS%20and%20TFS%20in%20the%20cloud