Jeff Sanders Technical Blog

I am a Microsoft employee that has worked on all aspects of the Web Stack for a long time. I hope these blogs are useful to you! Use this information at your own risk.


Latest Posts

Old Posts Restored

-

09 May 2022

I discovered some of my old lost posts were restored! technetblogs

Working At Microsoft Rocks

-

25 Jan 2022

Hello everyone! My name is Jeff Sanders and I am a Principal Escalation Engineer in Microsoft Azure Support. Our cloud offerings are all under the Azure name and our team supports Microsoft customers who are using one of the many Azure provided infrastructure, platform and software as a service offerings we have.

Azure Cosmosdb Managed Identity Failure

-

14 Jan 2022

Quick info blog - Customer code accessing Cosmos Db using the Azure Cosmos SDK showed failure in Application Insights: ManagedIdentityCredentials authentication failed.

Replace Text In All Files In A Directory Ubuntu

-

04 Jan 2022

A quick blog for search and replace text in a group of files using Linux Ubuntu. I needed to migrate Wordpress to a github pages blog that was using Jekyll and ran into trouble replacing text in the markdown.

Open A Support Case For An Azure Ad Tenant App Under A Subscription

-

29 Dec 2021

Your tenant may not be associated with a subscription.  For example you will see ‘jsandersrocksAAD’ is not associated with a subscription below:

Azure App Services Paas Notes

-

29 Nov 2021

People moving from an on-premise to Cloud implementation sometimes have difficulty understanding they do not have control over the underlying platform updates to their PaaS resources.  Azure App Services is a Platform as a Service (PaaS).  Simply put, a PaaS service gives you a platform to host your code and the provider updates the platform whenever necessary.  You cannot control when the underlying platform gets updated nor what gets updated.  You rely on the provider of the platform to handle security and platform updates and trust that the platform simply will work.  There are many advantages to a PaaS environment that I will not cover here.  We have learning resources that cover all the basics of Azure here: https://docs.microsoft.com/en-us/learn/paths/az-900-describe-cloud-concepts/

Customize Azure Cloud Shell Bash Environment

-

24 Sep 2021

I wanted to customize my Azure Cloud Shell Bash Environment to set the active subscription and define bash aliases at start up.  I could not find a good reference so here is how to do some simple things.

Preview Auth0 With Azure App Services

-

07 Sep 2021

There are a couple of articles available but they are out of date.  This is a step by step walk through of using OpenID (Auth0) with Azure App Services.

Where Do Azure App Service Advisor Emails Get Sent

-

01 Sep 2021

Azure App Service Advisor will send notification emails and add notifications to the portal when your app is not healthy.  Where does the email notification system retrieve a list of recipients?

Cannot Add Web App To Ase V3 Privatezonename Is Not Found

-

20 Aug 2021

I’m a dork so… quick blog here for those of you that fall into this too.  I created a new Azure App Service Environment (ASE) V3 and tried to add an App Service Plan and Web App to it and go the error “The template parameter ‘privateZoneName’ is not found”

Walkthrough Static Web Apps And Aad Authentication

-

02 Jul 2021

This is a step by step walkthrough of how to add AAD Authentication to Static Web Apps.  This is based on these documents:

Azure App Service Environment Ase Quick Reference

-

24 May 2021

There are many docs in the ASE official documentation now. I usually find ASE documents a little scattered on the Web and each time I’m on an ASE case, I spend a few minutes looking for the right doc. To avoid this, I was collating the links for my own reference and I thought it might be helpful to you too. I’ve put them scenario wise you don’t have to go through everything every time. I hope this helps!

Sendgrid 403 Authentication Errors

-

11 Dec 2020

SendGrid – Stopped sending emails due to SendGrid changing authentication requirements for the Sender of the email

Adding Capacitor Localhost To Azure App Service Cors

-

07 Aug 2020

Again… just a quick post.  The UI will not validate and allow you to add capacitor://localhost to the CORS settings in Azure App Services.  Here are two ways to work around it.

Azure Web Job Not Running

-

05 Aug 2020

Super simple.  Enable “Always on” for the web site.

Azure App Service 403 Causes

-

05 Aug 2020

There are a few reasons Azure App Services (Azure Web Apps, Azure Function Apps etc…) may get a 403 response.  Other than the code itself returning this, Access Restrictions or IP Restrictions could be at play (and you can mitigate with this knowledge).

How To Chart Scale Operations For Azure App Services And Function Apps

-

20 May 2020

Application Insights is a powerful tool to visualize what is happening with your application.  This quick query shows how to chart when instances are added and removed

Azure App Service Authentication Cors Error Easy Auth

-

23 Apr 2020

Using Easy Auth you might see this error: Failed to load https://login.windows.net/….: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘https://sitename.azurewebsites.net‘ is therefore not allowed access. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.

Using Graph Bindings With Node Js Azure Function Apps

-

24 Jan 2020

Using Graph Bindings with Node.JS Azure

Easy Auth Using X Ms Token Aad Access Token As A Bearer Token

-

17 Jan 2020

EasyAuth (https://cgillum.tech/category/easy-auth/)  generates an internal access token ‘x-ms-token-aad-access-token‘.  By default this token is an internal only format that you can’t use as a bearer token (it does not even look like one).  You can utilize an unpublished (until now) feature to authenticate against another resource and this will result in a bearer token being generated that you can use to access that resource.  The concept is that you can add additional login parameters that authenticate you against the object you wish to get an access token for.  So you log into that resource and an access token is generated for you by Easy Auth.  Special thanks to Connor McMahon who helped me get this all figured out!

How To Get And Analyze A Memory Dump Azure App Services

-

02 Jan 2020

Azure App Services has a way to retrieve and analyze a memory dump of your app right from the portal.  This is a quick reference on how to use this feature

How To Script Scale Rules For Azure App Services

-

04 Sep 2019

In this example I am showing how you can script setting the properties correctly in script to set a Scale operation based on some values you want.

How To Re Open An Azure Support Case

-

04 Sep 2019

If your case is closed and for some reason you problem is not resolved or re-occurs you can follow these instructions to view your past cases.  Once in that view, you can send a message and this will re-open the issue.

Azure App Service Deny Or Allow Http Verbs

-

07 Aug 2019

You may want to restrict what verbs you allow to your web apps in Azure App Services.  The way you do this is really no different than how you would do this for these web servers on premise or in a VM!

Custom Startup Script For Php Azure App Service Linux

-

06 Aug 2019

You have an option to create a custom startup script when using our provided (commonly referred to as ‘blessed’) images for PHP

Create A Fault Tolerant App Using Azure App Services And Azure Sql

-

24 Jun 2019

Azure guarantees 99.95% uptime or better, but sometimes your application or database misbehaves due to something you have done (written bad code) or in the rare event there is a problem in a region.  There was not a good end to end sample of setting up an Azure App Service that was deployed to multiple regions to be responsive and that utilized auto failover if a resource or data center went down so I created this one!  This will illustrate how you can quickly and easily lay the foundation for a Geo-Distributed application in Azure built on Azure App Service, Azure Traffic Manger and Azure SQL.

Where Are The Archived Appservicesteam Blogs

-

24 Apr 2019

For example:

Test Azure Function App Key Access

-

24 Apr 2019

You can test the key that Azure Functions uses when communicating to it’s associated storage account.  This is a great troubleshooting step if you get errors that the function is not accessible.

Test In Production Specify Slot And Test With Custom Domain Name

-

14 Mar 2019

You can use Deployment Slots and direct a percentage of the production traffic to a particular slot.  If you want to test only that slot say with the custom Domain on the production slot and ensure you hit that slot, you need to add a Cookie called x-ms-routing-name and specify that slot I want to route to.  In this example I am going to route to the test slot:

Azure App Service On Linux Copy Files From Container That Does Not Use Websites_enable_app_service_storage

-

04 Feb 2019

If you need to move files from a container and you are not using WEBSITES_ENABLE_APP_SERVICE_STORAGE, you will notice you cannot see the files when you SSH into the Kudu container.  In order to get these files into Kudu to easily transfer them you can use the linux tool ‘ncftp’. 

Failed To Update Web App Settings The Storage Uri Is Invalid

-

05 Jun 2018

When updating your Azure Function App storage account keys, if you specify the wrong key… You could get an error including the text:

Create Service Principal In Linux For Azure Automation

-

29 May 2018

There are lots of ways to do things in Azure.  I could not find a current end to end sample of setting up and getting an Access Token using SSH on a Linux box.  I chose the latest Ubuntu image up in Azure Virtual Machines for this overview.  This is loosely based on this older blog which had you create a PEM certificate (which is no longer necessary)

Steps

Azure Cloud Service Err_spdy_inadequate_transport_security Error In Chrome

-

03 May 2018

I ran into an interesting error that I had to debunk where a customer thought with HTTP/2 on Windows Server 2016 which has IIS 10 installed, that this caused the error above.  That was not true!

Point Kudu To A Particular Web Worker Instance

-

26 Feb 2018

Kudu is the .SCM interface for Azure App Services.  If you are running more than one instance of Azure App Services (for instance you have scaled out to 4 instances) and you need to get to the Kudu console to do something like kill a process, profile an instance or get a dump of a particular instance… you can use this technique.  This technique does not rely on ARRAffinity being set for the Application because that setting does not affect the Kudu site. 

Error Could Not Find A Part Of The Path Esitesroot0binroslyncsc Exe

-

22 Feb 2018

After publishing the web app to Azure Cloud Services from Visual Studio 2017, it would not run and returned a 500 error.  Turning off custom error messages I was getting this error: Could not find a part of the path ‘E:\sitesroot\0\bin\roslyn\csc.exe’. In your solution explorer for your project, right click on the ‘References’ section for your WebRole and select ‘Manage NuGet Packages…’ full stack:

How To Capture A System Net Trace From Powershell

-

15 Feb 2018

PowerShell can and does use System.Net classes to communicate over the wire.  This example will cover capturing a System.Net trace of the Azure PowerShell Publish-AzureWebsiteProject command-let.

How Tell If Your Mac Supports Support Intel Virtualization Technology

-

13 Feb 2018

I was trying to see if my MacBook Air support HAXM for Android emulation and could not find a good resource to tell me how to find out what the processor number of my Mac was. So here you go!

Usinginstalling Fiddler On Mac Os

-

08 Feb 2018

I could not find a good walkthrough so here is one for you.  Disclaimer:  This is on the latest OS and Latest version of Fiddler Beta

Azure Mobile Apps Disable Swagger

-

31 Jan 2018

The Azure Mobile Apps quickstarts can support Swagger.  What if you want to disable this?  This walkthrough shows you where the Swagger routes come from and how to remove them

Azure App Service Error Aadsts50011 The Reply Address Http Azurewebsites Netsignin Oidc Does Not Match The Reply Addresses Configured For The Application

-

30 Jan 2018

When you deploy an Azure Active Directory application that was working great locally you may get the following error when logging in:  AADSTS50011: The reply address ‘http://.azurewebsites.net/signin-oidc’ does not match the reply addresses configured for the application: ‘c8a23e63-b4e3-4d10-9cf8-0fca55207424’. More details: not specified

Easy Tables How Can I Manipulate And See My Data Efficiently

-

15 Dec 2017

The Easy tables feature of Node.js backend Azure Mobile Apps is a great way to do your initial development.  Once you get a few hundred rows of data however the browser based interface simply does not work well.  This is when you should move to an alternative.  This also allows you to run SQL queries and filters to narrow down the data you want to see or manipulate.  This guide is for the option when you are using Azure SQL for your backend database.

Image Files Do Not Deploy When I Add Them To Asp Net Project

-

30 Nov 2017

You might notice that when you add files like images (.png .bmp) to your project that these are not updating to your Web App (Azure Web App or on premise).

Force Https For Azure Web App

-

30 Nov 2017

Sometimes you need or want to force HTTPS for Azure App Services (Azure Web App, Azure Mobile App, Azure Function App, etc…).  In the past you could do this with a web.config change.

Switching From Dropbox To Github Expected A Git Repository But Found A None Repository

-

27 Nov 2017

If you have dropbox selected for a deployment option and want to switch to github you may get the error message:  Expected a ‘Git’ repository but found a ‘None’ repository at path ‘D:\home\site\wwwroot’.

Install Visual Studio Code On Ubuntu 16 04 Lts

-

13 Oct 2017

I had trouble getting Visual Studio Code to install by simple clicking on the package from https://code.visualstudio.com.  Whether I tried do download or use Ubuntu Software to install this I got an error: status code 400: Bad Request.

Easily Create A Sas To Download A File From Azure Storage Using Azure Storage Explorer

-

12 Oct 2017

In this scenario, you want to provide your customer with a secured URL to download a file from Azure Storage.  You can do this programmatically of course but another option is to use the Azure Storage Explorer to create a Shared Access Signature (SAS) for your customer.  Then provide the URL necessary with the SAS so that they can download the resource securely over HTTPS.

Azure Web Apps For Containers Simple Walkthrough Of Node Js App Deployment

-

12 Sep 2017

This is a super simple walkthrough to show how to use Git and push your app to Azure Web Apps for Containers.  It will not persist your Git repo but is a super quick way to show how this is done and perhaps help you if you are having troubles getting your app configured!

Asp Net Do Not Use Task Result In Main Context

-

28 Aug 2017

You can guarantee you will deadlock if you have a call similar to this in your code, where CallHttp is a an AsyncTask that awaits a result:

Azure App Service Authentication Using A Blob Storage For Token Cache

-

10 Aug 2017

Chris had this note in his blog App Service Token Store

Walkthrough Add Azure Web App To Visual Studio Team Services 2

-

18 Jul 2017

In this walkthrough I will show  you how to use Visual Studio Team Services with an existing Azure App Service project (specifically an Azure Web App).  We will add a task to update/create the project database from a DACPAC file and enable CI (Continuous Integration).

Azure App Services Authentication To A Foreign Azure Active Directory

-

09 Jun 2017

You have some code you have created in your subscription and a customer wants to authenticate and use your application.  You are not connected to any other Azure Active Directory authentication.  This is bit of a contrived example but will give you some insight in to how Azure App Services authentication works.

Checklist For Creating Your First Net Azure Webjob

-

30 May 2017

I thought it would be beneficial to add a checklist of things you may have to do when creating a .NET Azure WebJob.  Some of this applies to any Azure WebJob, but I will focus on a .NET Visual Basic WebJob (since I have not done that type before).  I chose not to include many screenshots because the portal UI changes frequently.  This article accomplishes the same thing but has a lot of overhead:  https://docs.microsoft.com/en-us/azure/app-service-web/websites-dotnet-webjobs-sdk-get-started  It also shows how to do some things differently from how I will show you.  PLEASE read that as well.

Azure Net Core Application Settings

-

16 May 2017

This article outlines how to work with Application Settings in ASP.NET Core with Azure Web Apps (Azure App Services) super simple Jeff version…

How To Azure Webjob Calling A Web Page Using Powershell

-

12 May 2017

Just a quicky post to get you started on how to use CRON expressions and Powershell to call a web page from a WebJob.  There are many different ways to use Azure WebJobs and this is using a Powershell script to call an endpoint and scheduling this using CRON.

How To Run Classic Asp On Azure Web Apps

-

11 May 2017

We mention you can use ASP on Azure Web Apps but documentation is a bit scarce.  This walkthrough will show how to deploy a simple vbscript ASP page to a Azure Web App.

Function App Error We Are Not Able To Retrieve The Runtime Master Key

-

09 May 2017

When you access an Azure Function app from the portal it will attempt to retrieve the Function runtime keys.  This is documented at https://github.com/Azure/azure-webjobs-sdk-script/wiki/Http-Functions#api-keys .  There are a number of reasons why the keys cannot be retrieved and this article documents a recent change that means you may see this issue.

Iis Azure Web App Force Https Alwayson Ping Should Return 200 For Fastcgi Sites

-

28 Apr 2017

PHP, Java and other FastCGI hosted environments should respond to an Always On ping to keep the child process warmed up.  Specifically in Azure App Services we send a request to the Root of the site with the header User-Agent: AlwaysOn.  If you are forcing HTTPS using a Url Rewrite rule, the Always On ping will get a redirect but will not follow that redirect and therefore the FastCGI module will not be hit and kept warm.

Page Loads Slow And You Notice Certain Files Js Html See To Be Extra Slow Downloading

-

14 Apr 2017

You notice particular files (.js, .html and more) are downloading very slowly

Azure Api Apps Troubleshooting Powerapps Export Error Unable To Download Swagger 2 0 Metadata Please Verify That The Url Is Publicly Accessible You May Need To Enable Cors For The App Service

-

06 Apr 2017

There is functionality in the Azure Portal that allows you to use the API definition of your Azure App Service and Export this through the “Export to PowerApps + Microsoft Flow” button in the API definition blade of your app ref: https://docs.microsoft.com/azure/app-service/app-service-export-api-to-powerapps-and-flow .  If you get the error: “Unable to download Swagger 2.0 metadata. Please verify that the URL is publicly accessible. You may need to enable CORS for the App Service portal extension located at”  It can be sometimes difficult to resolve this error.  This should help you however!

Azure Active Directory Cant Access The Account Account Recovery Where Does The Email Contact Come From

-

04 Apr 2017

If you are not using the Self-Serve option of Azure Active Directory premium, an email is sent to unblock the user account.  Where does that email come from?  I could not find it documented anywhere.

Problem Adding Push Notification Hub To Azure App Service Slot

-

30 Mar 2017

You can add Push Notification Hubs to your Azure Web App, Azure Api App etc… (all Azure App Services).  If you try to use the portal to add Push (a Notification Hub) to a Slot however this will fail.  You will see the portal will just sit there with the message: “Connecting Web App to Notification Hub” forever.

Accessing Azure App Services Using Azure Ad Bearer Token

-

17 Mar 2017

Here are some simplified instructions on how to setup and use Azure Active Directory authentication for Azure App Services and code that will allow an application to use a Bearer Token to access that app.

Accessing Azure App Services Using Azure Ad Bearer Token 2

-

17 Mar 2017

Here are some simplified instructions on how to setup and use Azure Active Directory authentication for a client Azure App Services application and code that will allow a client application to use a Bearer Token to access a different target app.   In this scenario there are two web apps.  The client app is the app that has code to call to the target app.  Anyone can reach the client app without authentication and the client app then uses a Bearer token to access the target app which requires Active Directory Authentication.  This assumes you have already created both apps in the Azure Portal

Cannot Read Property Listregistrationsbytag Of Undefined Azure App Services

-

23 Feb 2017

Calling Register or RegisterAsync in the client code can result in a 400 status code coming back with an inner exception of: ‘Cannot read property ‘listRegistrationsByTag’ of undefined’

Azure Traffic Manager Probe Degraded Due To 401 From Azure Web App

-

06 Feb 2017

Your Azure Web App (or any Azure App Service) has authentication enabled but you want to use Traffic Manager.  Since the probe returns the HTTP status code 401, the endpoint is considered degraded.  This blog only applies to Azure App Service Authentication.  If you are using a third Party like Auth0 you need to provide a non-authenticated URL using a different method.

How To Get A Full Memory Dump In Azure App Services

-

02 Feb 2017

There are a ton of blogs on getting full memory dumps but some get complicated.  Note then when you create a full memory dump it will have the effect of pausing your web app so use this judiciously!  Here is my simple version

How To Use Fiddler To Debug Azure App Service Issues With Authentication 2

-

11 Nov 2016

Sometimes it is difficult to isolate Azure App Service issues to determine is the problem is the client or server.  You can remove the client easily using a tool like Fiddler or Postman however is you are using authentication there are some tricks you need to use.  I will demonstrate this with Azure Mobile Apps, but this will work with any Azure App Service using authentication.

How To Use Fiddler To Debug Azure App Service Issues With Authentication

-

10 Nov 2016

Sometimes it is difficult to isolate Azure App Service issues to determine is the problem is the client or server.  You can remove the client easily using a tool like Fiddler or Postman however is you are using authentication there are some tricks you need to use.  I will demonstrate this with Azure Mobile Apps, but this will work with any Azure App Service using authentication.

Run An Async Task In A Console App And Return A Result

-

07 Oct 2016

I had someone ask how to run an async task in Main of a console app.  Yes there are different ways to do it and this is just one!

Easier Easytables For Azure Mobile Apps

-

30 Sep 2016

You could use the Azure CLI to create Azure Mobile Service tables for the node.js backend.  You can no longer do this but there is a much easier solution.  You can simply drop a .json file in the ‘Tables’ directory and when the app starts it will create the table in the database and make it accessible to the /tables/ route in your Azure Mobile App.  This only works for the node.js backend.

Execute Transactions From Azure Mobile App Api Node Js

-

21 Sep 2016

Using the Azure Mobile App API interface (like: https://mymobileapp.azurewebsites.net/api/doTransActionStuff ) with a node.js backend, I found documentation around executing SQL Transactions a little light.  So… Here are some options you could use:

How To Deny Http Methods Or Verbs In Azure Web Apps

-

20 Sep 2016

If you want to deny HTTP methods or verbs in Azure Web Apps you can do this be changing your web.config file.

Easy Tables Easy Apis Error Message Unsupported Service

-

24 Aug 2016

When you try to access or create Easy tables or Easy APIs in Azure App Services or Azure Mobile Apps you may get this error message in the portal: Unsupported service.

Azure Mobile Service Creation Fails This Name Is Already In Use

-

20 May 2016

Just a quick blog on this…

Troubleshooting Retrieving Certificates In Azure App Services

-

03 May 2016

You can upload and use Certificates securely in your Azure App Service (Azure Web App, Azure Mobile App etc… ).  If you are having trouble, here are some basic troubleshooting steps.

How To Add Custom Domains To Azure Web Apps Using Powershell

-

23 Feb 2016

Just another quicky post:

Azure Mobile Appshow To Remove The Notification Hub And Get The Wizard Back

-

19 Feb 2016

I noticed that you cannot change the notification hub in the UI.  There is a simple workaround (it will be fixed by the way).

Manually Attach A Debugger To Azure Web Apps

-

09 Feb 2016

For various reasons you may have difficulty attaching your debugger to an Azure Web App.  This quick blog will show you a method that may work for you if you get into this situation.  I will NOT attempt to diagnose your issue in this blog so please don’t post a question asking why the normal methods don’t work for you (like right clicking your resource in Server Explorer of Visual Studio).

Create A Staging Slot For Migrated Azure Mobile Service

-

29 Jan 2016

 

Remove Server And X Powered By Headers From Your Azure Mobile Apps

-

07 Oct 2015

Knowing the server type and what it is running can be information that an attacker may leverage.  This article explains how you can remove the subject headers.
Azure Mobile Apps are really Azure Web Apps.  You can configure the headers by altering the Web.Config just like you would with a standard ASP.Net application!

Azure Mobile Services Net Backend Found Conflicts Between Different Versions Of The Same Dependent Assembly

-

10 Oct 2014

If you get an error similar to this:
Changed service health to ‘Critical’ (Service is unhealthy. Please check the service logs to determine the issue and how to correct it.)

Charlotte Azure Partner Boot Camp Links For Mobile Services

-

06 Sep 2014

Mapping types: Mapping between Database Types and Client Types in the .NET Backend using AutoMapper

Cannot Upload Xap Error 2004

-

10 Jul 2014

Just a quicky post…

Walkthrough Attaching An Azure Sql Database To Your Net Backend

-

09 Jul 2014

I needed to attach an existing Azure SQL database to my .NET Backend.  This will allow me to expose existing data using the Azure Mobile Service I have defined.  This will walk you through the steps I took and get you on your way!

Always Drop And Create Local Database Net Backend For Azure Mobile Services

-

05 Jun 2014

In my early testing I wanted to always seed my Local Database.  By default the db was only dropped and reseeded if you changed the models.  There is a simple code change to do this.

Creating A Website For Polling Live Tiles

-

10 Apr 2014

You can very easily have your app Poll for Live Tiles.  What is cool about that is that you don’t have to register for Push Notifications and you can easily show updates to all users of your apps with low overhead.  Also, the user never has to run your app for Live Tiles to update.

Net Backend Helpful Links

-

09 Apr 2014

 

Create A Staging Net Backend For Testing

-

09 Apr 2014

Debugging on your Live Service is bad!  For instance if you are breaking in the debugger while one of your users is trying to get data, that call will likely timeout.  Also it is difficult to isolate an issue if multiple unplanned requests are coming into your service.  If you have some things you need to test or debug with your .NET backend, you can easily publish your .NET Backend code to a ‘Staging’ service to do your debugging.

How To Use Fiddler With Windows Azure Mobile Services Net Preview Backend

-

06 Mar 2014

I was using the Windows Azure Mobile Services .NET (Preview) Backend and wanted to see the HTTPS traffic.  I found the best way is to use Fiddler and modify the application so it will send traffic through the Fiddler proxy.  By default Fiddler will not catch the localhost traffic so you need to do a little trick to get IIS Express (Cassini) to work with this setup (ref: http://docs.telerik.com/fiddler/observe-traffic/troubleshooting/notraffictolocalhost ).

Powershell Script To Backup Windows Azure Mobile Services Scripts

-

25 Feb 2014

Listing for a PowerShell Script to backup Windows Azure Mobile Services scripts and configuration information.  I will get something more complete up on the Script Repository this next month!  This also assumes you have set your subscription active using Windows Azure PowerShell.  See How to install and configure Windows Azure PowerShell for more information.

Setting Up Eclipse For Windows Azure Mobile Services Development

-

18 Feb 2014

There were no detailed instructions for this and I ran into some problems when following our tutorial for this so here are my super easy to follow instructions.  I did this on Windows 8.1 64bit OS installed in a Hyper-V VM.  These instructions are for the 64 bit environment (I did not try the 32 bit).

Quicky Post Troubleshooting Receiving Push Notifications Using Android Eclipse

-

14 Feb 2014

I confirmed Windows Azure Mobile Services was able to communicate with GCM (Google Cloud Messaging) and had no errors sending the notification to GCM.  But how could I see how this got or didn’t get to my Android Emulator?

How To Convert An Image To Grayscale

-

25 Nov 2013

I ran across an issue where I wanted to convert an Image in a Windows Store app  to grayscale and could not find a great example.  So… here is one for you to try!

Problem Signing With Safenet Ev Certificate

-

30 Oct 2013

I had an interesting case that I want to share in the event anyone else experiences this problem.  In this case a Symantec certificate stored on a SafeNet USB dongle was being used to sign a Windows Store app in Visual Studio.  The signing was failing.  Visual Studio reported: “SignTool Error:  An unexpected internal error has occurred”.  These guidelines were followed and everything seemed in order:

How To Popup A Xaml Webview Ui Async And Wait For Results

-

19 Oct 2013

I needed to popup a WebView and wait on an event before continuing.  There really was no illustration on how to do this so here you all go!

Attaching To A Windows Azure Mobile Services Database In Asp Net

-

12 Aug 2013

The preferred way to talk to the database you are using for you Windows Azure Mobile Services is through the REST APIs and by using the Clients we supply for you.  The reason you should go through the REST APIs is to ensure you are hitting the Scripts you defined in your Mobile Service.  I had a case where someone wanted to directly connect to the SQL Azure database in the backend to list data in a grid view.  The call would fail with this error: “invalid object name‘tablename’” where ‘tablename’ was the name of the table in the SQL Azure database.

Use Passwordvault To Store Your Tokenswindows Azure Mobile Services

-

24 Jun 2013

There was no end to end sample of how you might use the PasswordVault to store your JWT used for user authentication in Mobile Services.  I created this class to be used with your Windows Store app.

Using Parameters With Tables For Different Views Windows Azure Mobile Services

-

17 Jun 2013

In my two previous posts I discussed how to move your table filter logic server side, and how to use Virtual tables to get different views of data.  In this blog post I will show you how to pass parameters to you read script to get different views of the data.

Using Virtual Tables For Different Views Windows Azure Mobile Services

-

12 Jun 2013

Building on my last post (Move Your Client Logic to the Server – Windows Azure Mobile Services) I will show you how to create a Virtual (or dummy) table to give you a different view of your TodoItem table.  This Virtual table will not contain any records however.

Move Your Client Logic To The Server Windows Azure Mobile Services

-

12 Jun 2013

The Client Libraries for Windows Azure Mobile Services are powerful and allow you to embed logic within your client application.  The quickstart and sample applications give you a great overview on how to implement logic on the client to get the view of data you would like in the client application.  A different architecture for you would be to move this view logic to the server using the Server Scripting capability of Windows Azure Mobile Services so that you do not have to duplicate the client side logic for each platform that you target as a client! 

How To Troubleshoot Windows Azure Mobile Services

-

31 May 2013

Undoubtedly when developing application using Windows Azure Mobile Services you will get unexpected results.  This guide will help you isolate and troubleshoot the most common errors that you will encounter.  This post is not intended to solve you issues but help you isolate and simplify the problem so you can dig in deeper or engage Microsoft Support for additional help.  Also see: Mobile Apps Troubleshooting
Basic Architecture
To effectively troubleshoot a problem you need to understand how Mobile Services work.  A simple breakdown of the architecture is that there is a server component (your Mobile Service URL) and a client component (your application code).
When you create your Mobile Service, we host your Service on Azure and expose an HTTPS endpoint that allows your client code to access your data stored in your Azure SQL database.
Your Mobile Service (the server component) is hosted on Azure and depends on our Azure infrastructure to bring up your Service when it is needed (if free mode… the default) and provides logging and other services like the Scheduler.
The client will issue one of five types of requests to the server.  There is a login request and four data requests.  The client communicates with the server through the REST API over HTTPS (or HTTP).  If you are using Windows, Android, iOS or any other client, those libraries simply translate the client library code into an HTTPS call to the REST API.  Understanding this API is your key to troubleshooting difficult issues!  Here is a link to the REST API documentation.  Watch Josh’s video on this API to learn how to login, create, read, update and delete data without writing any client code!
The server has a script interface for the four data operations.  You can use logging in these scripts to determine if a request gets to your server and what parameters are being passed How to: write output to the mobile service logs.  In addition you can run a Scheduler script on demand or on a schedule and there too, you can use logging to troubleshoot.  Ultimately the scripts will communicate with your Azure SQL database.  You can see your data in the DATA tab of your Mobile Service or connect to the Database through the portal and view it there.
Troubleshooting the Problem is Isolating the Problem!
You need to determine where you think the problem is; the Mobile Service infrastructure, your Mobile Service, Azure SQL or client code, and then compare what the expected result is verses what you are experiencing.  Here are some steps you can take to isolate the problem:
Can you get to your Mobile Services dashboard (https://manage.windowsazure.com/) and click on your Mobile Service?  If not, perhaps there is a connectivity or network error where you are.
Are the Mobile Services healthy?  You can go to Windows Azure Service Dashboard and see if the Mobile Services are see the status.  Click on the RSS feed icon on the right of the Mobile Services to see any news about Mobile Services.  There is a link at the top of the page to get help if the service is not healthy.

Use Fiddler To Retrieve Data From Your Windows Azure Mobile Service

-

29 May 2013

Fiddler is a powerful tool that can help you isolate problems with your Windows Azure Mobile Service.  You can quickly eliminate your client code from the equation and start troubleshooting issues with this tool.  Here is how you can quickly test to see if you can fetch data stored in your Mobile Services!

Using An Existing Azure Sql Table With Windows Azure Mobile Services

-

24 May 2013

You can use an existing Azure SQL table with your Mobile Services by moving the table to the schema used by your Mobile Service.  This blog post will show you one technique to accomplish this.

Upgrading Or Adding References To Mobile Services When There Are Multiple Projects In The Solution

-

07 May 2013

When you have multiple projects in a solution (for example a Phone and Windows Store app) and you need to add a reference using nuget for each of them there are two methods you can choose from.  You can use the command line using the Package Manager Console or you can Use the Dialog.  Note: The latest version of Windows Azure Mobile Services is here: http://nuget.org/packages/WindowsAzure.MobileServices.

Carolina Code Camp Links

-

04 May 2013

Hey all… Thanks for attending the Windows Azure Mobile Services Troubleshooting talk!

Windows Azure Mobile Services Accessing A Stored Procedure From A Different Schema

-

02 May 2013

I needed to access a stored procedure in the same database but for a different schema and call it from a server side script in Windows Azure Mobile Services, however I was getting this error: Error occurred executing query:  “Error: [Microsoft][SQL Server Native Client 10.0][SQL Server]The EXECUTE permission was denied on the object ‘Test’, database ‘jsanders_db’, schema ‘jsandersauthdemo’.”.  This made sense to me because I was calling across Schemas.  The script looked like this:

Phonegap And Windows Azure Mobile Services Error Login Is Only Supported From Http And Https Urls Please Host Your Page In A Web Server

-

17 Apr 2013

Just a quicky!

Configuring Fiddler To Be A Proxy For Android Emulators In Eclipse

-

03 Apr 2013

I struggled with getting Fiddler to work with the emulators shipped with Eclipse.  Here is a quick reference for you to get Fiddler installed so you can debug HTTP and HTTPS traffic.

How To Add A Copy Code Link To Your Blog Post And Colored Code Blocks

-

21 Mar 2013

A nice touch to your blog is to have a link to copy the code you have entered.  Another great feature is to have your code colored as it would be in Visual Studio.  There a couple of ways you can do this.  Here is how I prefer to do it!

Server Script To Insert Table Items In Windows Azure Mobile Services

-

20 Mar 2013

I needed a script to load a database with dummy items.  I created a Scheduler script with a simple loop to insert 1000 items into my table.  I found that when I ran this script it would kick off and seemingly never complete.  What was worse, my service was returning a 500 internal server error when I tried to hit it!

How To Send And Expire A Tile Notification From Mobile Services Server Scripts

-

13 Mar 2013

We document how to send push notifications using Mobile Services fairly well.  You can use the wns object and push the notification.  This is documented here:

How To Decode Event Viewer Logs To See What Tile Notification Data Is

-

13 Mar 2013

Using Push Notifications for my Windows Store app I needed to debug what message was being received for my Tile Notifications.  The payload however was just a hex blob and THAT wasn’t too useful.  Here is what I did to find the payload and see what was in it.

Windows Store Developer Solutions Blog

-

30 Jan 2013

Hey all!  Check out this blog for more Windows Store and Windows Phone developer issues!

Atl Library And Windows Store Apps

-

27 Dec 2012

Just a quick post in case you run up against this issue.

Portable Class Library Error When Building A Windows Phone 8 Windows Store App Library

-

14 Dec 2012

I had a customer issue that I thought I would share in the event you run into this issue (it may save you some heartburn).

Building Package For The Windows Storethe Package Contains A Debug Framework Reference

-

23 Nov 2012

I was helping a customer with a problem they were encountering when trying to build a package for submission to the Windows App Store.  The error was:

Windows 8 Video Driver For Inspiron 1521 Radeon Xpress 1270

-

15 Aug 2012

I have an old (circa 2007) Dell Inspirion 1521 laptop and wanted to get a better Video driver installed for Windows 8.  I found a Vista 64 bit driver on the Dell site that seems to work very well (compared to the generic drivers): http://www.dell.com/support/drivers/us/en/19/DriverDetails/DriverFileFormats/Product/latitude-d531?DriverId=X2T0W&FileId=2731098358&urlProductCode=False

How Do I Figure Out What The Hex Error Codes From Winjs Xhr Are

-

08 Aug 2012

These codes are hex representations of the underlying WinINet error codes.  You can use calc to translate the code from hex to decimal and then look up that error here:

Client And Server Certificates In Windows Store Applications

-

18 Jul 2012

I answered a couple of certificate questions in the C# Windows Store applications forum that you all may find useful:

Where Is The Windows 8 Product Key

-

01 Mar 2012

Here! http://windows.microsoft.com/en-US/windows-8/faq

How To Take A System Net Trace From Windows Store Applications Developer Preview

-

16 Dec 2011

In desktop applications and services we frequently take System.Net traces to diagnose issues using the HttpWebRequest class, HttpListener, sockets, smpt etc… (and now the HttpClient classes).  We traditionally use the application configuration file (appname.exe.config) to enable the tracing.  The config file is read and the tracing parameters are used to trace the information we find useful.   Windows Store applications do not have configuration files however so you cannot use the application configuration file to take the trace.

Walkthroughcreating An Iis Server To Use With Wns Push Notifications And Windows Store Apps Rtm Update

-

02 Dec 2011

Moved to our new blog here:

Windows 8 On Acer Aspire One Netbook Screen Resolution Etc

-

15 Oct 2011

I was anxious to see what real memory usage would look like on my low end netbook.  It was better than Windows 7!  Less than 500M.  One problem I had was the native resolution of my netbook is1024X600 and the will not load Windows Store applications at that resolution.  I found a registry setting however to get higher non-native resolutions: “Display1_DownScalingSupported”.  As with any registry change make sure you back up the registry first before making changes.  I searched the registry and changed the value from 0 to 1 where I found it and restarted.  Now I can get 1024X768 and 1152X864.

A Simple Wildcard Mapped Isapi Extension To Remove A Header

-

20 Jun 2011

I needed a simple WildCard Extension to remove a header and could not find one.  This needs a little more error checking code but can get the job done.  If you use it and add some enhancements or find problems, let me know and I will tune up the example!

You Cannot Use Geolocation Geo Location In An Ie 9 Webbrowser Control

-

09 May 2011

If you build a WebBrowser control based application you will notice that Geolocation does not work properly. You do not get the prompt to accept the website “wants to track your physical location”. Because you do not get that prompt, you cannot accept this security prompt and you will not be able to use Geolocation.

How To Set The Proxy For The Webbrowser Control In Net

-

26 Apr 2011

I see some horrible solutions for this out on the web.  Most involve setting the proxy for the entire machine and then toggling it back off.  Here is a class that will allow you to set it ONLY FOR THE PROCESS that the control is hosted in.  You could call it like this:

Failed To Install Visual Studio Update Kb2455033

-

19 Apr 2011

I had trouble installing this update this morning.  I found that since I had installed the Windows 7.1 SDK as well, I had to first install Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 KB2519277.  This seemed to allow the other update work fine!

Super Secret How To Decode Base64 Basic Authentication

-

17 Mar 2011

OK, really not that secret.  Basic Authentication headers are pretty simple.  

Using A Client Certificate When Moving From The 2 0 To 4 0 Framework The Request Was Aborted Cannot Create Ssltls Secure Channel

-

03 Mar 2011

Code that was working on a machine with the 2.0 (3.5) version of the .NET framework all of a sudden failed when this was flipped to the 4.0 version of the framework.  The end error was “The request was aborted, cannot create SSL/TLS secure channel” and “AcquireCredentialsHandle() failed with error 0X8009030D”.  This code imported a client certificate and key and was not using a client certificate stored on the machine.  I enabled CAPI logging and took traces of the failed and successful cases to compare.  Enabling CAPI logging:

Certificate Revocation List Crl Check And Winhttp Proxy Settings

-

21 Feb 2011

Starting with Windows XP SP2, the Crypto API CRL check uses WinHttp (see: http://support.microsoft.com/kb/887196).  This can cause some confusion with network administrators and developers since they might have set proxy information for WinInet or applications using CryptoAPIs but the certificate validation fails for the https calls inside certain networks.

Wcf Client Inner Exception The Security Support Provider Interface Sspi Negotiation Failed

-

14 Oct 2010

Creating a WCF Client in Visual Studio 2010, I struggled with this error.  I was running as the currently logged on user and the service was as well so this made no sense to me.  I found that this entry in the client app.config was the culprit:

Winhttp Proxy Settings In 64 Bit X64 Environments

-

16 Sep 2010

There are two settings for WinHttp Proxy settings for a 64 Bit OS.  One applies to the 64 bit environment and one for the 32 bit environment.  You can use netsh for Windows 2008, Windows 7 and later OSes and proxycfg.exe for earlier OSes.  If you are confused and not sure where your WinHttp application is reading proxy settings from, the easiest way to determine where WinHttp is reading proxy settings from is to use procmon (process monitor).

Understanding Problems With Ms10 049 Kb 980436 And Ietf Rfc5746

-

08 Sep 2010

Understanding Problems with MS10-049, KB 980436 and IETF RFC5746

How To Programmatically Add A Querytable And Data Connection To Excel

-

05 Aug 2010

I needed to create an Excel Spreadsheet with a Connection object and link a QueryTable to it.  I could not find a good example of this so I thought I would share.  Please drop me a note if you found this useful!

Cannot Log On To Msdn Blog Site

-

11 Jun 2010

OK, I am a dummy.  I spent 30 minutes trying to associate my account with the MSDN Blog sign in so I could author a blog.  Since the change of the site it asks you for your screen name and password.  Since I have my Live account associated with the Blog, I thought it wanted my Live ID information.

How To Iterate List All Selected Items In A Databound Listbox In Net 4 0 Winforms

-

07 May 2010

A seemingly easy thing to do that I could not find documentation for!

Excellent Information On Windows Web Service Api Wwsapi

-

22 Apr 2010

Having issues developing native C++ Webservices?  Here is an AWESOME blog:<p mce_keep="true">http://blogs.msdn.com/haoxu/</p>

Url Rewrite 2 0 Rule Can Prevent Images From Displaying On Webcontrols Like Treeview

-

19 Mar 2010

I was excited to try URL Rewrite to create some rules on my internal web site.  I added a rule to map a query string like http://mysite/treepage.aspx?nodeName=RedColors to http://mysite/RedColors .  After doing this I found that the images of the treeview web control now did not display.  I enabled FREB tracing and found that this rule was translating webresource.axd improperly:

Net 2 0 Httpwebrequest Does Not Use The Https Proxy From Internet Explorer Settings

-

16 Mar 2010

The .NET framework version 2.0 has the ability to get the IE proxy Settings and use them when making a WebRequest.  However it only will read the http static proxy and not use the https value when specified.  See this example:

How To Iterate Over Contained Controls To Set A Common Event Handler Click In Net

-

14 Oct 2009

The requirement was to assign a click event handler to all Label Controls contained in a .NET User Control.  This is a simple technique but I found there was no good documentation on how to do this. 

Winhttpwritedata Will Fail With Error_invalid_parameter If You Are Trying To Send More Data Than Specified In Winhttpsendrequest On Windows 7 By Design

-

13 Oct 2009

There are new checks in Windows 7 to prevent you from doing bad things with the WinHttp APIs.  In the sample code below, I do not get an error pre-Windows 7 but on Windows 7 the WinHttpWriteData call results in bResults being 0 and GetLastError() returns 87 (ERROR_INVALID_PARAMETER):

How To Walkthrough Using Httplistener Or Http Server Unmanaged Code C As An Ssl Simple Server

-

29 Sep 2009

There seems to be no simple end-to-end walkthrough for creating a simple HttpListener based SSL Listener that includes how to configure the computer by generating and installing a Certificate for this listener.

How To Get A Dump For A System Net Webexception Using Debugdiag Debug Diagnostics

-

29 Sep 2009

This information is available in the help file as well.  For more options please refer to the Help Documentation include with DebugDiag.

Troubleshooting Asp Net The Remote Certificate Is Invalid According To The Validation Procedure

-

16 Sep 2009

This error message is caused because the process is not being able to validate the Server Certificate supplied by the Server during an HTTPS (SSL) request.  The very first troubleshooting step should be to see if the server supplied certificate and every certificate in the chain is trouble free.

How To Get The Window Handle For The Internet Explorer Process You Created Lcie Ie 8

-

04 Sep 2009

One technique people use in accessibility applications is to kick off an application and then grab the Window handle of the process to hook it or do other processing.  With loosely coupled Internet Explorer (LCIE) this is a little more difficult that simply getting the handle of the iexplore.exe process you kick off.  The reason is that there is a broker IE process and this kicks of the actual IE instance.  Look at the links at the end of the article for more information how this works.

The technique you can use is to iterate over the processes and wait for your expected IE instance to get a valid window handle.  If there are no other IE instances running the technique is relatively simple.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> Here is a simple console application you can debug and play with to investigate this technique.

Using Httpwebrequest With Credential Manager

-

03 Sep 2009

A little know fact is that the .NET framework will use the stored credentials in the Credential Manager when accessing a network resource if the credentials exist for that particular resource (host).  I intend to clear up how this functionality works for the HttpWebRequests (you could extend this to WebService calls as well).

Using Netsh To Analyze Wininet Problems In Windows 7 And Windows 8

-

24 Aug 2009

There are some powerful tracing tools built into Windows 7 that can help you diagnose Internet Client issues.  This walk though shows you now to enable tracing when accessing a web site using Internet Explorer 8 or other WinInet based applications.

Writing An Isapi Filter With Net Managed Code Will Result In Poor Performance Of You Asp Net Web Applications

-

03 Aug 2009

David Wang wrote an excellent post about this in 2006:  http://blogs.msdn.com/david.wang/archive/2006/02/09/Can-I-write-an-ISAPI-Filter-using-Managed-Code.aspx

Winhttp Proxy Configuration On Windows 2003 X64

-

21 Jul 2009

You may get an error similar to this when running your WinHttp application:

Wininet Used In Thread Impersonation

-

09 Jul 2009

First and foremost, this is NOT supported for reasons stated in this article: http://support.microsoft.com/default.aspx/kb/238425. Primarily, problems occur because of information that is stored in the HKEY_CURRENT_USERS registry key and because of threading concerns.  Furthermore, due to security implications and the design of WinInet in Windows 7, this absolutely will not work in Windows 7.  Finally, in Vista, there is a Low IL cache as well as the normal (Medium IL) cache so this sample is ineffective at best.  This blog entry is mearly an excercise to help you understand how the Registry works with thread impersonation as I discovered when working on a WinInet problem.

Understanding Connection Limits And New Proxy Connection Limits In Wininet And Internet Explorer

-

29 Jun 2009

Because of RFC 2616 section 8.1.4 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html) we have traditionally limited the number of persistent connections to 2 per server.  This is because of the strong language in this RFC: ” A single-user client SHOULD NOT maintain more than 2 connections with any server or proxy.”<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” />

Infopath Form And Other Xml Office Documents Do Not Open From Internet Explorer Raw Xml Displays Instead

-

11 Jun 2009

I came across this problem.  The key to this was that the documents opened fine when clicking on them, so I knew the Office installation itself was fine.  Some rogue application on install or removal had apparently removed the appropriate Content Type registry key so Internet Explorer was unable to associate the XML file extension with any application.  Restoring the default OS registry entry allowed everything to start functioning again.  Warning, modify the registry at your own risk.  Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. <?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” />

Some Chm Files Do Not Work On Windows 7 Process Monitor Navigation To The Webpage Was Canceled

-

10 Jun 2009

This took me a couple of minutes to find so I thought I would share this here.

Wwsapi Samples In Windows 7 Sdk For Rc Unable To Add Url To Http Url Group

-

09 Jun 2009

I like to build and run with UAC on.  When running the HttpCalculatorService example I got this error: 

Understanding The New Wininet Options Internet_suppress_cookie_persist And Internet_suppress_cookie_persist_reset

-

08 Jun 2009

These options are well documented.  Important notes:

Understanding The New Wininet Option Internet_option_max_conns_per_proxy

-

08 Jun 2009

The documentation on this is very straight forward (http://msdn.microsoft.com/en-us/library/aa385328(VS.85).aspx).  At the time of publishing however the documentation has a slight error.  You cannot pass a handle in for the first argument.  It must be NULL or the call will return false and GetLastError() will show the error is: ERROR\_INTERNET\_INVALID_OPERATION.

Understanding The New Wininet Option Internet_option_server_cert_chain_context

-

05 Jun 2009

With the release of Internet Explorer 8 comes a new option you can query for with programming with the WinInet APIs: INTERNET_OPTION_SERVER_CERT_CHAIN_CONTEXT.  The MSDN documentation tells you it allows you to get the PCCERT\_CHAIN\_CONTEXT, and not much more.  It does not show you how to properly get the Context.  I like to see things in action so here is some sample code.

Understanding The New Wininet Option Internet_option_suppress_server_auth

-

04 Jun 2009

With the release of Internet Explorer 8 comes a new option for WinInet programming: INTERNET_OPTION_SUPPRESS_SERVER_AUTH.  The MSDN documentation is very specific and describes how the option affects authorization, but I like to see things in action!  How about some sample code for INTERNET_OPTION_SUPPRESS_SERVER_AUTH?<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” />

Understanding The New Wininet Flag Internet_cookie_httponly

-

04 Jun 2009

There are a couple of new Cookie flags introduced with the Internet Explorer 8 WinInet.dll.  The INTERNET_COOKIE_HTTPONLY flag allows you to read the HttpOnly cookies in your WinInet Code.  This flag is documented here: http://msdn.microsoft.com/en-us/library/aa384714(VS.85).aspx.  As always, I like to see examples of how this flag works!

Web Service Call Results In Exception A Socket Operation Was Attempted To An Unreachable Host

-

03 Jun 2009

There can be many reasons for this error.  In some cases this error can be confusing.  I have seen a few instances where an ASP.Net webservice call resulted in this error.  More perplexing is the fact that Internet Explorer on the same machine can reach the WebService fine.  If a firewall was blocking the traffic, most likely the Internet Explorer request to the same port would also be blocked.  Also to add to the confusion is when adding the usesystemdefault=true (default setting) did the proxy not get used.  The reason that usesystemdefault did not get the proxy is that IE stores the hard coded proxy information in the registry of the logged on user.  When ASP.Net runs, it is not running in the context of the currently logged on user (normally) and so it cannot read the same information that IE is reading to connect to the proxy.

How To Enable Winhttp Tracing On Vista 2008 And Windows 7

-

28 May 2009

WinhttpTracecfg.exe for Vista does not exist, so how can you get a WinHttp trace in Vista and above?

Wwsapi Samples In Windows 7 Sdk For Rc The Program Cant Start Because Msvcr90 Dll Is Missing From Your Computer

-

21 May 2009

I was messing with the latest samples in the RC for Win7 SDK (Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1: RC).

 

I build some of the WWSAPI samples and for the x86 platform, the samples would fail when I run them because of a missing dll.  Here is the error message I got:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

“The program can’t start because MSVCR90.dll is missing from your computer.

Understanding Maxservicepointidletime And Defaultconnectionlimit

-

20 May 2009

To understand these settings you need to understand how the HttpWebRequest class relates to the ServicePointManager and ServicePoint classes.  When you make a request with the HttpWebRequest class, the ServicePointManager provides a ServicePoint object to the HttpWebRequest object to handle the connection to a web resource (web server).  This ServicePoint object manages all the requests for a particular URI Host and protocol.  For example:  There will be one ServicePoint object for all the requests in my sample because they are all going to the server JSAN1 and using the HTTP protocol.  The ServicePoint object has some settings to control how it services the requests.  You can set the default values for these settings on the ServicePointManager before any ServicePoint objects are created.  Once the ServicePoint object is created these default values will not affect existing ServicePoint objects, only newly created ones.

Iis 7 Adsi Error System Runtime Interopservices Comexception 0x80005000 Unknown Error 0x80005000

-

13 May 2009

The following code worked fine on IIS 6 but when used on IIS it failed:

How To Get Certificate Information Using Wininet Apis

-

17 Apr 2009

There are two different structures you can query in order to retrieve server certificate information.  You must do some sort of request to complete the SSL server certificate exchange, and then you can retrieve this information.  Here is an example of that technique.
C++ code listing for sample (Copy Code):

Asp Net Aspmenu Does Not Display Child Menu Items In Ie 8

-

06 Apr 2009

Strange.  I found in my personal website the Child menus were not showing when I hovered over the root menu item.

You Have A Net Control Hosted In Internet Explorer 8 And It Restarts A Tab In Internet Explorer

-

01 Apr 2009

<?xml:namespace prefix = o ns = “urn:schemas-microsoft-com:office:office” /><p style="MARGIN: 0in 0in 10pt" class=MsoNormal>Message: This Tab Has Been Recovered </p> <p style="MARGIN: 0in 0in 10pt" class=MsoNormal>Previous versions of IE are fine.</p> <p style="MARGIN: 0in 0in 10pt" class=MsoNormal>If the control implements IObjectSafety or other interfaces improperly, this could cause this message.

Wwsapi Windows Web Services Api Http Kerberos Client

-

31 Mar 2009

Further adventures with the WWSAPI Beta.  If you find this useful please take the time to Jot me a quick comment or note!

Windows Web Services Api Client Code Walkthrough On Windows 7

-

24 Mar 2009

I decided to Dive into the WWSAPI Beta and see how I could call a simple HelloWorld Applications.  Here are my adventures:

My Favorite System Net Trace Configuration File Dumps Process Id And Date Time Information

-

24 Mar 2009

Often you need to correlate a .NET trace with a <a title=”Netmon” href=”http://www.microsoft.com/downloads/details.aspx?FamilyID=f4db40af-1e08-4a21-a26b-ec2f4dc4190d&DisplayLang=en” target=”_blank” mce_href=”http://www.microsoft.com/downloads/details.aspx?FamilyID=f4db40af-1e08-4a21-a26b-ec2f4dc4190d&DisplayLang=en”>Netmon</a> trace.  To do that you need the date and time of the call from the <a title=”System.Net trace” href=”http://msdn.microsoft.com/en-us/library/ty48b824.aspx” target=”_blank” mce_href=”http://msdn.microsoft.com/en-us/library/ty48b824.aspx”>System.Net trace</a>.  This will do it!

Httpwebrequest Webexcepton The Remote Server Returned An Error 407 Proxy Authentication Required

-

24 Mar 2009

Problem

Httpwebrequest Exception Unable To Connect To The Remote Server When Using Ins Config Files

-

24 Mar 2009

Problem 

Httpwebrequest Class Does Not Use Port Number In Spn When Using Kerberos

-

20 Mar 2009

If you look at a Kerberos ticket when HttpWebRequest is trying to retrieve a resource, you will notice that it does not have the port number in the SPN.

Replace Soap Toolkit And Atlserver Classes With The Wwsapi

-

18 Mar 2009

SOAP Toolkit is out of support and the ATLServer Classes are not supported in VS 2008.  What to do for native C++ development?

Anaylyze Httpwebrequest Hangs With A Vb Debugdiag Script

-

23 Feb 2009

Useragent Call Results In Error Not Enough Storage Is Available To Complete This Operation

-

13 Jan 2009

I was able to cause this error in Internet Explorer 6 and Internet Explore 7.  I found that editing my registry entry so that the user agent was greater than 260 I could cause this error in jscript dialogs.  By removing entries to get below the size I could avoid the error.  This is the registry location for the user agent strings (see http://support.microsoft.com/kb/218933 for setting this using IEAK):

You Receive One Or More Error Messages When You Try To Make An Http Request In An Application That Is Built On The Net Framework 2 0

-

07 Jan 2009

Please send me a message or leave a comment to let me know if this Post helped you! 

Create A Script For Debugdiag To Analyze Managed Webexceptions

-

19 Dec 2008

DebugDiag was originally designed to help IIS engineers find issues in IIS.  It does not have a very rich experience however when analyzing Managed Exceptions.  I will show you how to modify some existing scripts and use then to analyze issues with the HttpWebRequest class.

How To Modify Injected Attributed Code In An Atl Control That Is Crashing

-

17 Dec 2008

(ATL Control Visual Studio 2003 Crashes long value) I found a problem in the injected code from Visual Studio 2003 for an ATL control that had a property that was a long (VT_I4) value.  You could reliably crash the control if you put it into an html page and had jscript in a loop, setting the value over and over (100 X) in this case would crash it.  To make the crash reliable, I turned off BSTR caching and set full gflags.  You could see the issue was the freeing of a BSTR twice. 

Using Net Httpwebrequest Class With Siteminder You Get A 403 Or 401 Error

-

11 Dec 2008

Download Fiddler from <font color=#0000ff>http://fiddlertool.com</font> and run this for an Internet Explorer browser session that successfully connects.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

The Underlying Connection Was Closed An Unexpected Error Occurred On A Receive

-

01 Dec 2008

This article is a great help http://support.microsoft.com/kb/915599 however, there is another potential cause.  If the target server resets the connection without replying with an HTTP status (for example 200 OK) you can also get this error.  Solution, find out why the server is reseting the connection.  Common causes include the target of the HTTP traffic is not handling exceptions and crashing, forcing the web server to recycle that process (app pool for IIS) and this sends the TCP RST.

Workaround For Wininet Dns Not Refreshing When Using Kb 263558

-

14 Nov 2008

If you are making Synchronous calls in WinInet, the DNS timeouts don’t appear to work when set (see: http://support.microsoft.com/kb/263558 ).

Analyzing Httpwebrequest Connection Saturation In Net

-

24 Oct 2008

WinDbg is a powerful tool and can use the SOS extension (that ships with the .NET framework) to look into and analyze Managed Code.  Another powerful tool is Debug Diagnostics.  It uses the same Debugger Engine that WinDbg uses and can run analysis scripts.  You can use Debug Diagnostics and a custom script to analyze hangs and performance issues with the HttpWebRequest class.

I will walk you through some techniques that will allow you to customize your own Debug Diagnostics script to analyze .NET HttpWebRequest connection saturation.

The technique I will use is to:

1.       Walk the threads in a Dump and look for Managed threads that have System.Net.HttpWebRequest.GetResponse on the stack.  To me that means we are waiting on a response and may indicate an issue.

2.       For each of the threads found above, I will get the ServicePoint object and see how many connections it allows vs.  how many it currently has.

3.       Make a suggestion on how to fix it!

DebugDiag (Debug Diagnostics) has a great help file and some starter scripts.  I wanted to use jscript so the starter scripts did not do much for me since they were written in VBScript.  I put all the metadata for the script on one line so that when I get script errors I can easily map this to the script I am editing in Visual Studio 2008.  Save the script (with a .asp extension) to the Scripts sub-directory of where DebugDiag is installed and it will show up when you start DebugDiag.

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> 

Here is the starting script:

Print From Internet Explorer Without The Printer Selection Box

-

01 Oct 2008

Quickie post…

Stream A Pdf File From A Website And Dont Cache It Client Side

-

25 Sep 2008

I had an issue where someone wanted to stream a file that was generated on the web server and prevent it from caching on the client.  The correct way to do this is to specify the Cache-Control: no-cache header.  When this was done however the pdf file did not display using https and on Windows XP.  After some research the method that worked for this scenario was to define an OBJECT tag and point the SRC attribute to the page that generates the file on the fly.

A Script On This Page Is Causing Internet Explorer To Run Slowly If It Continues To Run Your Computer May Become Unresponsive

-

23 Sep 2008

**Your get one of these errors when running Internet Explorer:
** Stop running this script?
A script on this page is causing Internet Explorer to run slowly.
If it continues to run, your computer might become unresponsive.

Troubleshooting Code That Uses The Http Protocol

-

25 Jun 2008

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Window Close Freezes Net 2 0 Webbrowser Control In Windows Form Application

-

23 Apr 2008

In the spirit of my post: <a class=”” title=”How To: Close the Form hosting the WebBrowser control when scripting calls window.close in the .Net Framework version 2.0” href=”http://blogs.msdn.com/jpsanders/archive/2007/05/25/how-to-close-the-form-hosting-the-webbrowser-control-when-scripting-calls-window-close-in-the-net-framework-version-2-0.aspx” target=_blank mce_href=”http://blogs.msdn.com/jpsanders/archive/2007/05/25/how-to-close-the-form-hosting-the-webbrowser-control-when-scripting-calls-window-close-in-the-net-framework-version-2-0.aspx”>How To: Close the Form hosting the WebBrowser control when scripting calls window.close in the .Net Framework version 2.0</a> the .NET 2.0 WebBrowser control has no control over the close events like WindowClosing.  One valid solution is to use the ActiveX version of the WebBrowser control.  Currently the .NET 2.0 WebBrowser contol simply wraps the ActiveX version anyhow!

Flash And Windows Media Player Movies Do Not Start In Internet Explorer

-

26 Mar 2008

An embedded WMP or Flash movie would not start when Internet Explorer loaded this page:

How To Wire The Readystatecomplete Event From The Xmlhttp Object In Internetexplorer Net

-

06 Mar 2008

I have a web page that has a global variable in the jscript called xmlhttp.  It is the build in XMLHttp object in Internet Explorer.  I am hosting the WebBrowser control in a C# (.NET managed code) application and I want to know when the XMLHttp object is done.  This occurs after the document complete event so how do I do this?

Building With Atlserver Based Soap Project With Visual Studio 2008

-

17 Jan 2008

**UPDATE: Replace ATLServer with WWSAPI! **<font color=#000000>**Windows Web Services API Client code walkthrough**</font>** **

 

 

When I tried to build an old ATLServer WebClient SOAP project I got these errors:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

fatal error C1083: Cannot open include file: ‘atlsrvres.h’: No such file or directory

fatal error RC1015: cannot open include file ‘atlsrvres.h’

 

Download the latest ATLServer code from http://www.codeplex.com/AtlServer and unzip it on the build machine.

 

Set the resource and C++ include paths of your project to point to the include folder location from the unzipped codeplex code.

 

Rebuild.

Msxml3 Dll Access Is Denied Msxml4 Dll Access Is Denied

-

15 Jan 2008

The following vb Script can fail with an “Access is denied” error message:

System Argumentexception Absolute Path Information Is Required

-

18 Dec 2007

You have a .NET 2.0 control hosted in a browser.  The control uses the System.Uri class.  When upgrading to .NET 2.0 SP1 you can get an error: System.ArgumentException: Absolute path information is required.

Chttpserver Not Included In Visual Studio 2008

-

10 Dec 2007

CHttpServer and CHttpFilter are not included in Visual Studio 2008.  You will get error messages such as: fatal error RC1015: cannot open include file ‘afxisapi.rc’ fatal error C1083: Cannot open include file: ‘afxisapi.h’: No such file or directory.  You have to convert your projects to straight ISAPI API calls or come up with some other scheme (such as building the MFC libraries from another version of Visual Studio).  I used the following steps to build a CHttpServer based project in the Visual Studio 2008 environment as a temporary workaround so that you can build your projects based on CHttpServer:<p class=MsoNormal style="MARGIN: 0in 0in 0pt">How to build CHttpServer based projects with VS 2008.</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt">The MFC ISAPI classes have been removed from VS 2008.  I suggest you convert over to straight ISAPI calls since in reality these classes are simply a very thin wrapper around ISAPI API’s.  Also, you own the code that you move over and build this way and you will not be able to get any security updates of support if you use this method.</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt">I recently converted a couple of projects that had been built with the MFC wizard in VS 2003.  For these I found by statically linking with the MFC libraries and copying some files from my VS 2005 environment to a local directory in my project, the projects built under VS 2008.</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt">Statically Link with MFC libraries.</p> <p class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1">

Windows Core Networking Team Site

-

28 Nov 2007

http://blogs.msdn.com/wndp/

400 Error From Webservice Using Net 2 0 And Preauthenticate

-

17 Oct 2007

Prashant from my team found this interesting issue.  I will blog it here until the KB comes out on this.

How To Send Soap Call Using Msxml Replace Stk

-

14 Jun 2007

I know… This is a simple thing, but there is no documentation on it so here it is:

How To Close The Form Hosting The Webbrowser Control When Scripting Calls Window Close In The Net Framework Version 2 0

-

25 May 2007

By design the WebBrowser Control does not close the parent Form when WebBrowser Control is closed.  Here is one way you can accomplish this.

How To Capture The Newwindow2 Event From A Managed Webbrowser Control

-

23 May 2007

The articles referenced in my post Internet Explorer WebBrowser Control loses state… discusses sinking this event by adding an unmanaged version of the WebBrowser control to your Form and using that.  But what if you want to use the Managed version?  The manged version of the WebBrowser control is really a wrapper around the unmanaged version of the control and has some neat features like automatically docking to the form.

Extra Characters Rn When Converting Mfc Isapi Under Vs 2005

-

11 May 2007

When you convert an MFC ISAPI project you created in an early version of Visual Studio to MFC 8 (VS 2005) you may notice that there is an extra set of carriage return linefeed characters.  This will be true if your code does not add a header to the return stream.  You can see this if you take the default project and comment out the lines as shown below:<p class=MsoNormal style="MARGIN: 0in 0in 0pt">

Internet Explorer Webbrowser Control Loses State When Jscript Performs A Call To Window Open

-

04 May 2007

Session state for a web site is often stored in cookies.  If you use the WebBrowser control in an program and the target website responds to an action with a call to Window.Open, then mysteriously the cookies for that site are not transmitted with the request.

The Servicepointmanager Does Not Support Proxies Of Https Scheme Net 1 1 Sp1

-

25 Apr 2007

This was an interesting error that I had to hunt down.  When specifying a proxy server in .NET like this: WebProxy(“https://someproxyserver”) you will get this error.  You will get this error for whatever scheme that you enter before the “://” characters.  For example if you use this: WebProxy(“somescheme://someproxyserver”) Then you will get the error message: The ServicePointManager does not support proxies of somescheme scheme.  The only scheme that is recognized by this class is http.

Internet Explorer Cache Filenames Are Not Configurable

-

25 Apr 2007

So What?  You may ask.  This sometimes may be confusing to users!