Tuesday, December 8, 2020

Code Quality Build tools

1. SonarQube - 

static analysis that finds all kinds of problems in your code 

2. Software Composition Analysis Tools: 

  • WhiteSource Bolt 
  • Black Duck (and) 
  • Snyk 

3. Zed Attack Proxy -

 a dynamic analysis tool which executes lightweight security penetration tests against your deployed code 

 Check Azure release pipeline scanning OWASP top 10 issues in your website
https://marketplace.visualstudio.com/items?itemName=CSE-DevOps.zap-scanner


 

Tuesday, August 25, 2020

Upgrade VS2015 TDS 5.0 to Vs2019 TDS 6.0

Step 1:First and foremost step- First thing First

Update latest version of nuget package




Set local nuget source and install new version 6.0.0.15 nuget package

Path = C:\Workspace\TDS 60015\TDS 6.0.0.15\NuGetPackages

 









Step 2: Update reference package


C:\Workspace\repo2019\packages\HedgehogDevelopment.TDS.6.0.0.15

Error you encounter while upgrading is……………………………………..!

Connection Test Pass: Content downloaded from http://abc-local.com//sitecore
Connection Test Pass: Sitecore TDS connection test successful
Connection Test Failure: Sitecore TDS Service DLL does not exist at \HedgehogDevelopment\SitecoreProject\v9.0\bin\HedgehogDevelopment.SitecoreProject.Service.dll.
Connection Test Finish: 2020-08-19 10:33:49
Connection Test Start: 2020-08-19 10:35:44


Unload all tds csproj project, edit and update folder name from something.5.0 to given 6.0 folder details

C:\Workspace\repo2019\packages\HedgehogDevelopment.TDS.6.0.0.15

Step 3: Connector Problem










looks like TDS is all over the place. Next stop is at this file path very complicated setup if you ask me that one try to upgrade it.

MSBUILD PATH


C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0





Build FAILED.
C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets(164,5): error MSB4018: The "VerifyTDSVersion" task failed unexpectedly.
System.IO.FileLoadException: API restriction: The assembly 'file:///C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.Tasks.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.ReflectionOnlyLoadFrom(String assemblyFile)
at HedgehogDevelopment.SitecoreProject.Tasks.VerifyTDSVersion.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
Done building project "abc.TDS.Master.scproj" -- FAILED.

Build FAILED.


Solution

If you closely look at this configuration on edit csproj. You will notice there is duplicate import of tds.target. Remove one of it.

<Import Project="..\packages\HedgehogDevelopment.TDS.6.0.0.15\build\HedgehogDevelopment.TDS.targets" Condition="Exists('..\packages\HedgehogDevelopment.TDS.6.0.0.15\build\HedgehogDevelopment.TDS.targets')" />
<Import Project="$(MSBuildExtensionsPath)\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets" Condition="Exists('$(MSBuildExtensionsPath)\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets') And !Exists('..\packages\HedgehogDevelopment.TDS....\build\HedgehogDevelopment.TDS.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\HedgehogDevelopment.TDS.6.0.0.15\build\HedgehogDevelopment.TDS.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\HedgehogDevelopment.TDS.5.5.0.15\build\HedgehogDevelopment.TDS.targets'))" />
<Error Condition="!Exists('..\packages\HedgehogDevelopment.TDS.6.0.0.15\build\HedgehogDevelopment.TDS.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\HedgehogDevelopment.TDS.6.0.0.15\build\HedgehogDevelopment.TDS.targets'))" />
</Target>
<Import Project="..\packages\HedgehogDevelopment.TDS.6.0.0.15\build\HedgehogDevelopment.TDS.targets" Condition="Exists('..\packages\HedgehogDevelopment.TDS.6.0.0.15\build\HedgehogDevelopment.TDS.targets')" />

This journey is getting way more complicated then I would have imagine or expected

Step 4

Build FAILED.
TDSVersion: 6.0.0.15
FrameworkVersion: 4
TDS Target file version: 6.0.0.15
C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets(297,5): error : Error(DirectoryNotFoundException) Could not find a part of the path 'C:\sitecore\abc\Website_DEV\web.config'. updating web config file 'C:\sitecore\abc\Website_DEV\web.config'
Done building project "abc.TDS.Master.scproj" -- FAILED.

Build FAILED.

Solution

I removed _DEV from c:/siteore/abc/website/

To prevent any conflict. So I have to bring that folder back again.

Step 5: My quest to conquer this upgrade is getting more convoluted. It was foreboding when I took this task at hand.

Solution


Make sure you follow below line items very closely

  1. Delete web.config from C:\Sitecore\abc\Website\_dev

Go the C:\Workspace\repo2019\packages\HedgehogDevelopment.TDS.6.0.0.15\build pick this TDSservice.asmx to past it in C:\Sitecore\abc\Website_DEV


  1. Now We would have build and publish our solution but I recommend don’t try that unless we install tds end to end. Now explicitly copy service C:\Workspace\repo2019\packages\HedgehogDevelopment.TDS.6.0.0.15\build\binHedgehogDevelopment.SitecoreProject.Service.dll into C:\Sitecore\abc\Website\bin

  2. Click on install sitecore connector. This will create web.config file with access guid as given in _Dev. If you open web.config you will notice the same guid is present. That is the magic.

  3. Now Test and you should be through. Voila!

Preface from tds sitecore doc-JFYI










 

??? Error communicating with TDS Service. Please see the Application Exception Log on the Sitecore Server for more details.

TDS was unable to connect to the Sitecore server. If this error keeps occurring check the following:

  1. Navigate to the Sitecore instance in a web browser and check that the site is available.

  2. Ensure that no firewalls are blocking access to the Sitecore instance.

  3. Navigate to the folder on disk that contains the Sitecore instance and check that the folder _DEV exists.

  4. Check that the _DEV folder contains the files TdsService.asmx and web.config..

  5. Check that the bin folder for the Sitecore instance contains the file HedgehogDevelopment.SitecoreProject.Service.dll.

 

  

Tuesday, August 18, 2020

VS 2019 and Sitecore TDS 6.0.05 upgrade from Sitecore TDS 5.0

 When you first install Sitecore TDS 6.0.05 try to locate tds 6.0 nuget package in your local. This nuget require you to update your reference nuget from 5.0 to 6.0. All you need to do is add new local path of nuget reference in Nuget manager and install this new nuget package.

After you have installed the updated nuget for each of your existing TDS project you might come across this error.

Verify the version of the MSBuild TDS Service DLL


Connection Test Finish: 2020-08-19 10:33:49

Connection Test Start: 2020-08-19 10:35:44

Connection Test Pass: Content downloaded from http://abc-local.com//sitecore

Connection Test Pass: Sitecore TDS connection test successful

Connection Test Failure: Sitecore TDS Service DLL does not exist at \HedgehogDevelopment\SitecoreProject\v9.0\bin\HedgehogDevelopment.SitecoreProject.Service.dll.

Connection Test Finish: 2020-08-19 10:35:44

Connection Test Start: 2020-08-19 11:09:03

All you need to do is unload the .csproj and edit the tds .csproj section where it imports the package service.dll into sitecore solution


Thursday, August 13, 2020

Azure App Configuration Feature toggling using Feature Manager

 You can store all feature flags in Azure App Configuration and administer them from a single place. App Configuration has a portal UI named Feature Manager that's designed specifically for feature flags. App Configuration also natively supports the .NET Core feature-flag data schema.

In this tutorial, you learn how to:

  • Define and manage feature flags in App Configuration.
  • Access feature flags from your application.