Sunday, March 1, 2020

Error: ENOENT: no such file or directory

When you are working with node js packages you might encounter  Error: ENOENT: no such file or directory, scandir '**/node_modules/node-sass/vendor' for one or some of the packages you are using.

execute following command for all the packages that gave ENOENT  error and it will fix the issue

cheers
Samitha


Tuesday, February 18, 2020

CSS select label

If we want to apply style for elements rendered  label for   use the following CSS

label[for=ID_of_the_Label]
{
    
}


Cheers,
Samitha

Sunday, February 2, 2020

'gulp' is not recognized as an internal or external command,

I have installed npm and working for the past few months without an issue. I was trying to execute a gulp task and came across the issue of gulp not working. The visual studio output displayed as follows

 'gulp' is not recognized as an internal or external command.

I fixed this issue by re installing gulp using  the following command

npm install -g gulp


Cheers,
Saamitha

Wednesday, January 1, 2020

FluentValidation validating bool

When validating boolean properties  using FluentValidation, use .NotNull() instead of .NotEmpty()

The reason behind this is NotEmpty() will consider only true as valid property whereas NotNull() will consider both true and false as valid properties.

Cheers
Samitha

Tuesday, December 10, 2019

Replace last charactor

I had a requirement where I need to replace all occurrences of \ in end of a string.

Regex helped me to achieved the expected result. The code for this is as shown below.

Regex.Replace(txtDomain.Text.Trim, "/+$", "")


Cheers
Samitha

Monday, November 25, 2019

jQuery modal Close contains additional text

if you are using jQuery modal you might see that the modal close icon has Close text alongside it.

This can be fixed using a simple css as displayed below.

<style type="text/css" >

.ui-button-icon-only {
   text-indent: -9999px;
}

</style>

Cheers
Samitha

Thursday, November 14, 2019

The CodeDom provider type “Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider” could not be located

You might have encountered above error when trying to run a Asp.net MVC project.

The cause of this issue is version changes in DotNetCompilerPlatform.dll. Check your web.config and make sure you have latest version as displayed below.

 <system.codedom>
         <compilers>

             <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />

             <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+" />
         </compilers>

     </system.codedom>

Cheers
Samitha