Issues / resolution setting up Unicorn for Sitecore 10.1.1 Helix-based project
Although a Helix-based solution is setup based on Helix conventions, there is a possibility that every developer interprets it in a different way and as a result, could end up setting the sln in a different or wrong way. Here is where tools/plugins help. In the following blog article, I'm setting up a solution manually and have documented all the issues and solutions faced. In my next blog article, I'm going to use Anders Laub plugin to setup the same sln and see if it helps streamline the process. Then, I plan to move over to using HPP-based convention.
Note that even in this process, I setup a working sln but then there are a few issues:
1. My serialization data store location is not specific to the feature but I set it up somewhere outside the Helix file structure
2. No naming standards generally, I follow "my way free way approach"
3. Most importantly, I created folder names / the whole structure manually
4. You could end up adding Feature-based config code in Foundation layer or vice-versa
But, only if you follow this approach, you will appreciate the beauty of plugins and boiler-plate code.
First basic step that could save a lot of time; In Visual Studio, ensure that web.config for all projects/ layers have this setting in order to overcome unnecessary DLL version errors while publishing to the web application or the destination folder:
Build Action - None
Copy to Output Directory - Do not copy
Ensure to rename Unicorn.DataProvider.10.1.config.disabled to a customized name, in my case, I made it CustomSitecoreCommand.Unicorn.Configs.config and added it under Unicorn\zzz before publishing to the target or the web application folder:
Next, Ensure to (re)name Unicorn.SharedSecret.config to Unicorn.zSharedSecret.config and have a valid shared secret value. I picked the shared secret value from the habitat project config. Chuck this file too under Unicorn\zzz folder.
Note that if you already used Unicorn.SharedSecret.config and had published the same to the target or the web app folder, ensure to delete the concerned file from the target folder since only Unicorn.zSharedSecret.config must be present in the target folder as per this Stackoverflow issue / solution
After setting up the above files, I could see the Unicorn page:
Note that at this point, if you run the Sync-Unicorn task in the Visual Studio Task runner explorer, you could still get this error if you haven't yet configured the datastore for sync:
Sync-Unicorn: Executing Sync...
Sync Unicorn
ERROR: Configuration(s) requested were not defined. (System.ArgumentException)<div class="stacktrace">at Unicorn.ControlPanel.Pipelines.UnicornControlPanelRequest.SyncVerb.ResolveConfigurations()
<br /> at Unicorn.ControlPanel.Pipelines.UnicornControlPanelRequest.SyncVerb.Process(IProgressStatus progress, ILogger additionalLogger)
<br /> at Unicorn.ControlPanel.Pipelines.UnicornControlPanelRequest.SyncVerb.<>c__DisplayClass3_0.<CreateResponse>b__0(IProgressStatus progress)
<br /> at Unicorn.ControlPanel.Responses.WebConsoleResponse.ProcessInternal(IProgressStatus progress)
<br /> at Kamsar.WebConsole.TextWebConsole.Render(Action`1 processAction)
<br /> at Unicorn.ControlPanel.Responses.WebConsoleResponse.Execute(HttpResponseBase response)</div>
****ERROR OCCURRED****
Error: Unicorn Sync to <web app root>/unicorn.aspx?verb=Sync&configuration=&skipTransparentConfigs=0 returned an
Error: error. See the preceding log for details.
At <dev folder>\scripts\Unicorn\Unicorn.psm1:66 char:3
+ throw "Unicorn $Verb to $url returned an error. See the prece ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (Unicorn Sync to...og for details.:String) [], RuntimeException
+ FullyQualifiedErrorId : Unicorn Sync to <web app root>/unicorn.aspx?verb=Sync&configuration=&skipTra
nsparentConfigs=0 returned an error. See the preceding log for details.
Next, ensure to add Unicorn.UI.IdentityServer.config.disabled file to Unicorn\zzz and give it a custom name, in my case, I named it - CustomSitecoreCommand.UI.IdentityServer.config
References:
https://www.youtube.com/watch?v=d3g0QMWSuGg&t=1534s
https://navansitecorenotes.blogspot.com/2021/07/npm-gulp-not-recognized-error.html
Comments
Post a Comment