Sunday, November 6, 2016

Configuring Visual Studio To Work With a Proxy

By default, Visual Studio and Nuget use your proxy settings from IE.  However, I work for a corporation that insists on continually reverting my IE proxy settings every 15 to ones that do not work with Visual Studio, meaning that I need to continually update them just to do my job.  The solution is to configure Visual Studio and Nuget directly to use your proxy so they do not rely on IE.

This post outlines how to configure the many components of VS to work with a proxy, however for Nuget it instructs to use the nuget.exe, which requires finding it.  An easier way is to edit the Nuget configuration file directly.  Also for most people you don't need to specify your credentials as the proxy is usually configured to use integrated authentication by default.  Below is a summarised version of the steps required to get VS and Nuget to work:


  • Open the VS configuration file located at "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.config".  Change the path appropriately depending on your version of Visual Studio and whether you are using the x64 or x86 variant.
  • Update the configuration section to look as follows:
<system.net>
<settings>
<ipv6 enabled="true"/>
</settings>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy bypassonlocal="true" proxyaddress="http://address:port" />
</defaultProxy>
</system.net>
  • Open the Nuget configuration file located at "%AppData%\NuGet\NuGet.Config"
  • Update the configuration section to look as follows:
<configuration>
...
<config>
<add key="http_proxy" value="http://address:port" />
</config>
...
</configuration>
  • Restart (or start) Visual Studio and confirm that you can restore and browse for packages successfully
Thanks to the this answer on SO for the location of the Nuget config file

Monday, August 22, 2016

adb sideload Nexus Android - "Device not found" correct fix

The issue is that you follow the instructions to sideload a factory Android image to your Nexus and when you put the phone in adb sideload mode and try to upload the image, you receive the message "device not found".  This may happen even though you previously could see that the device was connected to your computer and listed using adb devices.  Other people have posted how to fix the issue but it does not work for you or you.

The page linked above talks about modifying the driver inf file to include the identifier of your specific Nexus device.  The problem with this, is that it appears the USB driver is no longer update by Google for specific Android devices (even if you grab the latest using the SDK manager) nor does it actually need to be if you follow these instructions.  Actually, updating the inf file means that Windows will be able to automatically detect and install drivers for your device, but it can be difficult for the average user to find the device identifier and do this.  Instead it is easier to do the process manually:


  1. Follow the instructions above until you get your device to the point where you have selected sideload using adb from the recovery screen and your device is displaying Now send the package you want to apply to the device with "adb sideload "
  2. At this point you may see Windows pop up a dialog with the text Installing drivers for your device but it will fail and be unable to find the drivers.  Usually at this point, you will be unable see the device in your device manager and manually install the drivers
  3. Unplug your device and plug it back in.  Again you should Windows attempt to install drivers for your device.  This time when it fails, go to the device manager and you will see Android device with an exclamation mark.  You can now manually install a driver for the device by using the Google USB drivers you downloaded.  You will be presented with 3 options - select ADB composite device and the drivers will be installed
  4. You can now sideload the device using the command adb sideload  as described above
If you need to find the USB driver manually because you do not have the SDK manager, you can find more details here.