Posts

Adding Code Coverage for ASPNET CORE projects

If you are not able to get code coverage when you run unit tests through Visual Studio for ASPNET core projects. Try following the below steps and hope that helps. 1) Add below Nuget packages to your VS test project Microsoft.NET.Test.Sdk MSTest.TestAdapter MSTest.TestFramework 2) Add "DebugType" as "Full" in the ASPNET core project   <PropertyGroup> ...     <DebugType>Full</DebugType>   </PropertyGroup> 3) Add "Microsoft.CodeCoverage" Nuget package to the ASPNET core project.

Find logical Processors

1) Open a cmd prompt 2) Run this command: wmic cpu get NumberOfCores,NumberOfLogicalProcessors/Format:List

Convert Wma to Wav or mp3 file

WMA is a proprietary format of Microsoft. Hence even SOX tool which converts most of the formats cannot do this. ffmpeg tool for windows did the trick for me. This is an open source tool. ffmpeg.exe -i input.wma output.wav Make sure you are using the latest version else the conversion may fail. I was able to use this exe and invoked from my c# application to get the job done. This was easier than using the MediaTranscoder class in UWP for my simple requirement.

Oahu (hawaii) 7 Day Trip in Feb, 2017

Day 1:   My wife and I arrived late in the night the previous day, so our trip started in the afternoon. First place to visit was Byodo- In Temple. Lord Buddha's Statue with calm and peaceful atmosphere, this is a must visit place for people who is visiting Oahu. FYI - I do not follow Buddhism ☺️ . Then we visited Kailua Beach Park, without doubt I will rate it as my favorite beach in Oahu. As this is a beach park, this will have showers and restrooms.   Day 2:   Pearl Harbor Visitor Center - Most of the people know some history about this place and you get to know more. If you haven't heard about it then you have to visit for sure. Plenty of parking, no handbags, wallets are allowed inside the center. You can carry camera, phones, bottled water but no bag packs and handbags. In the night we went to Waikiki Beach for exploring the night life. Ate the delicious shave ice cream as well.   Day 3:   Planned to start early in t...

Find a string in number of files

To find out a string in a file from a directory (which has many files), this command should be helpful.. findstr -spin "String" *.* Here we are finding string in subdirectories, ignoring case, and in all the files(anyname.anyextension)

OcsLogger Application may not be run when Centralized Logging Service is Running.

We can get this error as the title of this post when you try running OcsLogger.exe. Resolution: 1) You can run Stop-csclslogging command in Lync Server Management Shell 2) Or just stop Lync Server Centralized Logging Service Agent from Services.msc

System going to sleep mode even after setting "Put the Compuer to Sleep is set to Never"!!

Image
This can also happen if  "Allow hybrid sleep" is set to ON. Try changing it to OFF as shown below and try your luck!  

Cisco AnyConnect Secure Mobility Client - VPN service not available. The VPN agent service is not responding

Sometime there may be a possibility that Cisco AnyConnect Secure Mobile Client can crash and service will be continuously crashing if you go and see it in services.msc. I faced this issue when my laptop was shutdown forcefully and below I listed the resolution I found.. Client Version:  3.1.04049 Resolution: Open the browser you have been using. From the options, delete the complete browsing data stored.  Then I found that service was crashing but it gave me a couple of secs opportunity to enter my password to connect to my VPN. I entered my password quickly and then I was successfully able to connect to the VPN and didn't face this issue again. Stupid resolution but still it may be useful for few more people here..

OS Installation getting stuck at "Completing Installation" phase

I was getting the error as mentioned in the title of the post. And leaving the installation for even 10 hours didn't fixed the issue for me. So what I did is just removed all the external monitor connections and all the USB connections once the system restarted for the first time and yes I succeeded :)

Certificate error while loading PPT in Lync 2013

If you are getting Certificate error( There was a problem verifying the certificate from the server. Please contact your support team ) while loading PPT in lync 2013, then uncheck the following Internet Setting and try again. Internet Options -> Advanced -> Security(Check for server certificate revocation) And if the above setting doesn't work then make sure the root certificate for WAC(office web apps) and Lync server is exchanged correctly.

Camera not working when we install Windows embedded 7. usbvideo.sys is missing

When we are using any Windows embedded template like Application Compatibility, there is every chance that camera may not function properly after the installation is done. Reason: 1) Drivers not getting installed properly or missing drivers. 2) Check if usbvideo.sys is available in %dir%\Windows\system32\drivers . If the driver is missing then that means you may haven't connected camera while installing the OS. Even if you have this file that doesn't mean camera will work properly. You need to have this usbvideo.sys file and we need to install proper drivers. Solution: Connect the camera when you are installing the image. This may give good result but if this is not working then follow the below procedure. 1) Install Windows Embedded 7 toolkit on a Windows 7/XP machine 2) Open Image configuration editor from All Programs -> Windows Embedded standard 7 3) Create a new answer file 4) In the new answer file, select application compatibility as default (from the...

System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8000/... Your process does not have access rights to this namespace

When you get the error as mentioned in title. Please check the below things: WCF service has to run as administrator If you want to run this service locally then we can workaround this error. For this please follow the below blog: http://blogs.msdn.com/b/avkashchauhan/archive/2011/03/22/opening-an-internal-http-endpoint-with-wcf-servicehost-basichttpbindings-may-cause-system-net-httplistenerexception-system-servicemodel-addressaccessdeniedexception.aspx But the catch here as the blog says, it is totally internal to the machine. External WCF clients cannot communicate with this WCF service. If you are logged in as Local user in the machine. Then run the application in elevated mode to avoid this error.  

Mute Unmute Lync SDK

Setting Mute/Unmute State on Lync through Lync SDK: UnMute:                            Conversation conv; //Once you have the conversation, set the unmute on Lync as below.   IDictionary < ModalityTypes , Modality > modalities = conv.Modalities; Modality mod = modalities[ ModalityTypes .AudioVideo]; bool canHold = mod.CanInvoke( ModalityAction .Hold); //Check if we can invoke Hold on the conversation. i f (canHold) mod.BeginSetProperty( ModalityProperty .AVModalityAudioCaptureMute, false ,UnMuteOccured, null );     Mute: Mute is simple as mentioned below.   conv.SelfParticipant.BeginSetMute( true ,MuteOccured, null );       private void UnMuteOccured( IAsyncResult ar){} private void MuteOccured( IAsyncResult ar){}      

Access Edge service failed to start: Transport TLS has failed to start on local IP address

When we get the below errors in the event viewer on the edge service: A configured transport has failed to start. Transport TLS has failed to start on local IP address 10.x.x.x at port 5061. Cause: Configuration error, low system resources or another program is using the specified port. Can also happen if the IP address has become invalid. Resolution: Ensure that the IP address specified is valid and that no other program is listening on the specified port. Unable to bind for socket. Transport:TLS, IP address: 10.x.x.x, Port:5061. Error:0x80072741 (The requested address is not valid in its context.). Resolution: Ensure that no other program is listening to the specified port and that the IP address is valid. Then most probably the error can be that your IP address got changed and the topology builder is still using the old IP address. This can happen when you are using DHCP instead of static assigning. Resolution: Change the IP in the topology using the topology build...

Topology builder mmc crash (Lync server installation)

When we are about to publish topology, if MMC crashes then the probable reason  might be wrong AD preparation. For this first of all remove the configuration store  location and then publish the topology after selecting thee correct CMS     Remove-CsConfigurationStoreLocation

Sending a mail with image in the message body

EmailMessage message = new EmailMessage (exchangeService); message.Subject = "test"; message.Attachments.AddFileAttachment( @"test.bmp" ); message.Attachments[0].ContentId = test.bmp@123 ; message.Attachments[0].IsInline = true ; message.Attachments[0].ContentLocation = path; //Image path Without content location and ContentId we will not get the image in the message body. Make sure you add the Content ID in the HTML to get the image.

Cannot load Counter Name data because an invalid index '' was read from the registry

If you are unable to get the performance metrics of a machine: Running this command from command prompt may help: lodctr /r Check if all are enabled: lodctr /q

Interview questions

1) What are constraints? These are used to constraint(limit) the data that can go into SQL tables There are generally six types of constraints in SQL: NOT NULL Constraint - Check Constraint - Default Constarint - Primary Key Constraint - Unique Key Constraint - Foreign Key Constraint - 2) What are ACID properties? ACID stands for Atomicity, Consistency, Isolation and Durability. Database professionals when evaluating the database, looks at these features of database. Atomicity: Each transaction is said to be atomic. If one part of the transaction fails, entire transaction should fail. Its all or none rule. Consistency: Only valid data should be written into database. If a transaction is executed that violates the Database consistency rules then entire transaction should be rolled back. Database should not leave your transaction in half finished state. Isolation: Database should isolate two concurrent transactions until they are finished. Durability: Any transac...