Thursday 9 November 2017

?? in C# (double question mark operator in C#) Or null coalescing operator

null coalescing operator


The operator "??", yes two question marks. called as  "null-coalescing" or just the double question mark operator.

According to the Microsoft, help page: "The ?? operator returns the left-hand operand if it is not null, or else it returns the right operand."

eg : var result = answer1 ?? answer2;
            can also be written as below
var result = answer1 != null ? answer1 : answer2;

if answer1 is not null =>
     result = answer1

if answer1 is null =>
   result = answer2

?? will be better uasable when we have to check for multiple null values for a result

string result = answer1 ?? answer2 ?? answer3 ?? answer4;
For more information please check
https://stackoverflow.com/questions/446835/what-do-two-question-marks-together-mean-in-c

Thursday 13 July 2017

Process with an ID ???? is not running in visual studio 2015

Possible Solution 1: 

  • Close VS.
  • Navigate to the folder of the solution and delete the hidden .vs folder.
  • Restart VS.
  • Hit F5 and IIS Express should load as normal, allowing you to debug.
Possible Solution 2: 
  • Close all instances of Visual Studio
  • Rename the IISExpress folder (in my PC is in C:\Users\jmelosegui\Documents)
  • Add the _CSRUN_DISABLE_WORKAROUNDS Environment System variable with the value of 1. Here is how.
  • Start Visualstudio in administrator mode
Possible Solution 3:
  • open vs as an administrator
  • right click project and click on unload project
  • again right click project and click on open edit.... csproj
  • find the code below and delete it $
    <DevelopmentServerPort>63366</DevelopmentServerPort>
    <DevelopmentServerVPath>/</DevelopmentServerVPath>
    <IISUrl>http://localhost:63366/</IISUrl>
    
  • save and close the file .csproj
  • right click project and reload it
Source : https://stackoverflow.com/questions/26424902/process-with-an-id-is-not-running-in-visual-studio-professional-2013-update