Nuget packages not found after installing Visual Studio 2022

I recently needed to install Visual Studio 2022 on one my existing machines to debug a new zeroshot model that has a dependency on our Speech SDK. The Speech SDK is one of our key #AI services in Cognitive Services (as part of #AzureAI). I already had VSCode running, but in this case I need the bigger brother.

After installing Visual Studio, I could not get any nuget packages to install; I could not even fetch anything and didn’t matter what I used – the package manager console in Visual Studio, PowerShell, etc.

Nuget would only point to the local offline package store, which in my case is available at: C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\. I kept getting the error: Package X is not found on source 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'

I could not understand the behavior, and not seen this before. Turns out it is a known issue, albeit not very common. Seems like if either PowerShell’s Install-Module, or Chocolatey’s coco command was used before using nuget or Visual Studio for the first time, this will happen.

The solution is to add nuget.org as a package source, and the URL it should point to is: https://api.nuget.org/v3/index.json. Below is the screenshot on what this looks in Visual Studio for me:

Screenshot showing updated nutget package sources in Visual Studio 2022
Updated nuget package sources

If one is setting up a brand new dev box, the odds of you running into this is low; in my case given I was adding Visual Studio 2022 much later is what caused this. There is more details on this here too.

Clearing out Windows 10 command prompt history

My command prompt history is quite long, and a lot over time is not essentially garbage. I was looking at a way to clean it out. Most of the solutions online I found were not correct – I don’t know if things changed over time, but the latest version of Windows I am on (Windows 10 Pro 1803), it did not work.

So, here are two ways that you can do this. One is using the registry editor (RegEdit), and the other is running a simple script that you can either copy and paste from below or you can download and run it.

If you are going to be using RegEdit, and living dangerously then Press WinKey + R and type “regedit” (without quotes) and press enter to get the Registry Editor going as shown below.

Run command to start Registry Editor

And on the new Windows navigate to the following key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU and delete that. You can right click on the key name and choose delete.

It is important to double check because if you miss it, or delete something else, there is no recovery. (Why do you think I was saying, you like to live dangerously). See the screenshot below.

NOTE: It is always recommended to backup the registry before doing this, so at least you could restore it back to the state. To backup select File -> Export.

A better way, and less dangerous would be to run the following script in a elevated command prompt (i.e. a Admin command prompt) which will do the same thing, but more safer. You can just copy the command from below and paste it. Or alternatively you can download this simple script and run it locally (also from a elevated command prompt).

reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /f

Mouse without borders issue – Only one usage of each socket address

I have been using Mouse without Borders, a program that allows you to make a virtual KVM between machines for some time at home and it is awesome. You can use one set of keybard and mouse among various (windows) machines including clipboard and copy and paste. If you haven’t tried it, I would highly recommend it.

However lately I could not connect between two machines and kept getting the error: “Only one usage of each socket address“. To the point where it was unusable and was pretty annoying. I looked online at their site but nothing jumped out. BTW, I was seeing this only on one machine (running Windows 10) and not the other one (also running Windows 10 but an inner ring of the Creators Update – essentially the next version of Windows).

What I understand the issue to be is that Windows is running out of ports and where programs that use a port for a short time, it won’t matter much, in this case the port is always going to be used.

The solution that seems to be working for me is quite simple – we increase the number of ports available to Windows. This is quite simple and to do this if you run an elevated command prompt and copy and paste the following command:

netsh int ipv4 set dynamicport tcp start=1025 num=64511

And if you are not sure on how to get the elevated command prompt – easiest way to do that is press WinKey + X, and from the menu select Command Prompt (Admin) as shown below.

Elevated command prompt menu
Elevated command prompt

Less than Symbol in Latex

If you want to show a simple less than symbol (i.e. <) in Latex, you are in for a surprise as you cannot use that character as is. If you are in math mode and writing this part of a formula then you might be still OK, but if you are in text mode then it is quite difficult.

Surprisingly, searching for this online also did not provide any obvious answers (perhaps I was searching for the wrong thing).

Anyways, I did figure it out in the end, and I needed to use the \textless directive for latex. I also found a few more symbols and have them listed below in case they are helpful for anyone else.

Symbol Latex Command
^ \textasciicircum
< \textless
> \textgreater
~ \textasciitilde
ª \textordfeminine
* \textasteriskcentered
º \textordmasculine
\ \textbackslash
\textparagraph
| \textbar
· \textperiodcentered
{ \textbraceleft
} \textbraceright
¿ \textquestiondown
\textquotedblleft
\textquotedblright
\textquoteleft
\textquoteright
\textbullet
© \textcopyright
\textdagger
\textdaggerdbl
® \textregistered
$ \textdollar
§ \textsection
. . . \textellipsis
£ \textsterling
\textemdash
\texttrademark
\textendash
_ \textunderscore
¡ \textexclamdown
  \textvisiblespace

Rich Copy – a Robocopy GUI

I needed to copy a bunch of data (Photos and Music) from my primary laptop to both the WHS and MCE and instead of hand crafting a Robocopy script I came across something called RichCopy (download from here) which is a much better version of Robocopy GUI and allows for quite a few advanced features. If you use Robocopy a lot then I would highly recommend using this – you can setup multiple profiles depending on your environment.

How to remove a corrupt driver on Windows

If you are having constant issues with a specific hardware, then one of the culprits could be a corrupt device driver for that hardware. In simple terms, a device driver is nothing but another computer program which allows Windows and other applications to interact with the specific hardware. Since this is very hardware specific, generally one need to install the specific drivers for that device.

Windows has something called “Device Manager” which as the name might suggest is used to manage devices. Devices are nothing but the various hardware elements that make up your computer. Some of these are internal (such as CPU, RAM, Hard disk, etc.) and other external such as the monitor, printer, mouse, etc.

At a high level, the process is as follows:

  1. Open Computer Management
  2. Find the corrupt/offending device in Device Manager
  3. Remove the device (and possibly remove the drivers as well)
  4. Re-install the device (including the drivers if required).

I have a few screenshots showing the step-by-step process. Whilst these screenshots were taken on a Windows 7 machine, if you are running Vista, the process is the same.

Step 1 – Opening Computer Management

  1. Click on Start
  2. Right-click on the Computer (on the right side of the Menu)
  3. From the new menu select “Manage” as shown below.
  4. You need Administrator rights for this, so depending on your Security Setting, Windows might ask you to Confirm or ask for different credentials.

image

 

Step 2: Opening Device Manager

A new window called Computer Management will open. On the left, under System tools you will find an option called “Device Manager”. Click on that and on the right hand side you will see all the devices of your computer;  the devices are grouped by different categories as shown below.

image

If there is a problem being reported with some device (for whatever reason) then you will see a Yellow warning triangle next to it. For example in the screenshot below you can see the NVIDIA nForce Networking Controller has some issue. On the other hand, if all the devices are operating correctly (or at least that is what Windows thinks) then you won’t see this and would see something similar to the screenshot above.

image

Step 3: Uninstalling the Device

Select the device you want to uninstall and right click on it. From the new menu, select the Uninstall option as shown below.

image

Step 4: Removing the Driver

When you choose the Uninstall option (from Step 3), you will get a confirmation screen as shown below. If the driver is corrupt or causing issues, then you check the option which says “Delete the driver software for this device”.

WARNING: If Windows cannot automatically install your device because you need to either download the drivers from the manufacture’s website or use a CD/etc. then make sure you have this before you choose to Delete the driver software.

image

Step 5: Reboot (Optional)

Windows might not ask you to reboot. But depending on the device it might be a good idea to reboot just to make sure everything is cleaned out.

Step 6: Add back the Device

If you did reboot, next when you start and login, in most cases Windows will automatically find the new device and either install the drivers or ask you for the CD or path where the driver software can be found.

On the other hand, if you did not reboot or Windows did not detect your device automatically, then you go back to Device Manager (as shown in Steps 1 and 2), right click on the Computer name (this will be the first item in the Device Manager). From the menu choose the “Scan for hardware changes” option – Windows should now find out device.

image

Solving the iPhone Sync Error–Unknown error occurred (13019)

Recently the wife installed the latest iOS update for her iPhone 4 (all 600+ MB of it! And people have the misconception that Microsoft software is bloated?). After the update, the Sync on the phone was failing with the following error: “The iPhone cannot be synced. An unknown error occurred (13019)” as shown in the screenshot below.

She did have the latest version of iTunes – not that made any difference. Also, restarting iTunes or rebooting the phone and the machine did not help and the error remained the same. After a quick search online, it seems quite a few others have the same problem.

clip_image002[4]

For her the sync failure was because of the Music (as did most other people with the same issue); but the failure can be in any group (App, Ringtones, etc.) and not necessarily restricted to the Music group. The easiest way to find out the group where the Sync failed is to keep an eye on the Sync status – it will stop in the group wherever it failed and then you will get the above error.

To fix this error you need to stop syncing the group causing the issues and then re-sync it. Essentially, you reset the sync options for that group. At a high level the steps you need to do are:

  1. Stop syncing the group that failed.
  2. Sync the phone.
  3. Re-enable syncing for the group from Step 1.
  4. Sync the phone again.

In the wife’s case, here are the steps I had to follow to stop the Music from syncing to fix this.

Step 1: Select the Device in iTunes (when it is connected of course).

clip_image002[6]

Step 2: On the right hand side, select group which is failing and uncheck the Sync option. For example, choose Music and uncheck the Sync Music checkbox (circled in red). You need to click the Apply button on the bottom.

image

Step 3: Be warned, when you uncheck the Sync Music option, iTunes will delete all the music on your phone as shown in the screenshot below. Of course you should only do this from the computer where you have all your music. If you don’t then you won’t be able to sync your music back again. Click on the “Don’t Sync Music” button.

clip_image002[8]

Step 4: Sync your phone as usual.

Step 5: Reverse of Step 2 – you select the "Sync Music” option again and click on Apply.

Step 6: Sync your phone as usual and everything should sync up again as you would expect. Of course this could take some time depending on how many items you have in your group.

Using cached domain (active directory) credentials or not?

If you are ever in a situation where you want to find out if you logged into using cached domain credentials (AD) or authenticated against the domain controller then the easiest way is to open Event Viewer and look for the entry where the source is NETLOGON and Event ID 5719.

The description would be something like:

Log Name:      System
Source:        NETLOGON
Date:          27/05/2011 08:53:17
Event ID:      5719
Task Category: None
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      YOUR-Full-Qualified-Computer-Name
Description:

This computer was not able to set up a secure session with a domain controller in domain YOUR-DOMAIN-NAME due to the following:
There are currently no logon servers available to service the logon request.
This may lead to authentication problems. Make sure that this computer is connected to the network. If the problem persists, please contact your domain administrator. 

ADDITIONAL INFO
If this computer is a domain controller for the specified domain, it sets up the secure session to the primary domain controller emulator in the specified domain. Otherwise, this computer sets up the secure session to any domain controller in the specified domain.

Here is a screenshot (on Win 7) showing a (filtered) view of the same event.

image