Fixing error - ID4175: The issuer of the security token was not recognized by the IssuerNameRegistry.

by bhavikv 12. April 2013 14:34
I was trying to setup my own ADFS Server and my web app talking to it, but stumbled upon this error on my web app.
ID4175: The issuer of the security token was not recognized by the 
IssuerNameRegistry. To accept security tokens from this issuer, configure the 
IssuerNameRegistry to return a valid name for this issuer
A plain simple Bing search lead me to this blog post. I am posting the solution for the benefit of all.
The error really means that there is a mismatch between the issuer certificate details mentioned in the web.config's <Microsoft.identityModel /> section. So back to your ADFS server grab that thumbprint of the certificate and update it in the web.config of your app.
      <issuerNameRegistry type="Microsoft.IdentityModel.Tokens.
ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel,
Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <add thumbprint="d9c160d223ae97b26605627d8e6dd39c045e08c3"
name="" />
      <certificateValidation certificateValidationMode="None" />
There are more details about other exceptions and how to fix them here.

Tags: ,

New posts coming soon

by bhavikv 12. April 2013 14:32

After a deep slumber of over a year, I am planning to write new posts over multiple technologies - WIF, ADFS, C#, Windows Phone 8 based on my earlier experiences. So in case you want me to cover some topics, please let me know via email/comments.




Some blog posts missing after failed upgrade

by bhavikv 20. November 2011 21:06

Hi Folks,

Some of my previous blog posts are missing after I tried to upgrade from BlogEngine.NET 2.0 to BlogEngine 2.5. Luckily I had a backup all the posts data and restored it back on my web server but BlogEngine surprising doesn't recognise the posts in the App_Data folder. Sealed

Hope to get them restored by next weekend. Any inconvenience caused is regretted.

Update - Got the blog restored. It came back automatically! I guess the app pool refreshed itself.

- Bhavik


11 things I have learnt in first 3 years of work at Microsoft

by bhavikv 21. August 2011 20:32

I am very lucky to have started my career in one of the best companies in the world – Microsoft. And as expected I have learnt a lot from it in past three years of working here. Microsoft has a very unique and distinct work culture, with a lot of great folks to learn from and look upon.

I am going to list down and share few things that I have learnt at Microsoft. I am hopeful this would help those who have just joined the IT industry or are going to join it in near future.

1. I love Microsoft

Loyalty - I believe this is the first and foremost belief on which you must build the foundation of your career. And this is what the company expects the least out of you. After all, they are the one who are paying you. Surely, you can avoid evangelizing the products your company makes – but think for a second, if you being an employee don’t like/buy/use the product, do you think anyone else will?

Bonus Tip: You *should* not use company resources for your personal use. Also, being a appropriator won’t serve you in the long run.

2. Stand and Deliver

If you deliver what you committed, you are achieved and deserved your Salary. The terms “committed”, “achieved” are probably specific to Microsoft, but I think there is similar terms and rationale used everywhere else. And if you fail to keep your promise, its clear you are “underachieved”.

I feel this is the most important learning I have got at Microsoft. We are not used to think like this. Isn’t it?

3.  Find your “Sachin Tendulkar” at work

You need to find someone at work whom you idolize. Build relationships, make him/her as mentor and try to learn maximum from them. Role models will help you focus and channelize your energies in one direction – your goal. Read the next one which completes this point.

4. Trust the right people

Its really difficult to do this right the first time. You are an new entrant to a unknown group of people. You faced this situation earlier when you were a fresher in your first year of college. But you had lot of time to make mistake and improve on it. Trusting wrong people, and looking up to them as role model will influence you in a wrong way. My advice, be cautious and take the advices with a pinch of salt.

5. “I hate politicians”

Stay away from Office gossips and politics. They are breeding ground for killing your creativity and loyalty. We all are/will be subjected to politics at some point of time. And its better to ignore than react to them. Believe me, you’ll get into these sort of situations now and then. Its very crucial to be cognizant and not take sides and try to leave the discussions apologizing and without hurting anyone’s sentiments.

6. Differentiating crows from crows

It’s important to listen to the feedback – good or bad. But its as important to disregard the "Ad Hominem" feedback. This kind of feedback is just blatant negative without soul and thought. These is the kind of feedback that will make you think, "Am I like this?”, “Did I do that?”. Instead of ignoring it, it’s always great to have a candid talk with the person sharing you this feedback about if this is something that he/she noticed couple of times and seek for help and guidance.

Bonus Tip: Always share constructive feedback – one that they can use it to improve. The tone of the feedback determines if you want to help him/her or point out their faults.

7. Humpty Dumpty had a great fall!

I think its more important to fall than to succeed. You learn a lot while falling (oops), fallen (sigh), trying to stand (urge) and standing to the challenge again (I can do it!). Also don’t spend time and energy explaining or reasoning out why you failed. Instead use this as an experience to avoid such mistakes in future.

8. Bad Appraisal

It’s no use crying over spilt milk. Get over it, act on your next steps. Based on my discussion with number of colleagues – peers, manager and organization leaders, they never recollect about their ratings/rankings. Not saying that you shouldn’t care about it. But what’s gone for the past year, cannot be changed. This ranking made them more determined to prove a point. Hence don’t let the rankings/ratings which I refer as “Moh Maya” bring you down. Focus on the next point instead!

9. Goal!

Identify your life goals. Stay focused and channelize all the efforts towards this one or two things you want to achieve in your lifetime. Also I find that it’s good idea to experiment when you have nothing to lose at the start of your career. Always weigh and see what you are sacrificing to achieve it and then decide its real worth.

10. Date with my GF v/s Work

Don’t try to mix personal and professional life. Keep your Work-Life-Balance healthy and do give the time your loved ones deserve. You’ll get lot of opportunities at work to become successful, but one miss at personal life, you’ll never get it back.

11. Extras

If you have reached this point, you are not bored and find some value in my post. So I think you deserve to know more from my experience. Which is why I am sharing the following tips I think are noteworthy, specific to –>


  • Know Your Company – Don’t they do a background verification on you when they hire you? On a serious note, try to know what your company does to earn the moolah, promoters or shareholders, its CSR initiatives, stock price, impact to the world – the more you know your company, more you’ll be attached to it.
  • Help your company products to improve by sharing the feedback, finding bugs and doing usability tests.


  • Its as critical to blend into the team as to stand out. Remember, you are a team member first!
  • Try to make your team successful, you’ll eventually become successful.
  • Respect the various cultural background of the team members and give enough space for your team partner to feel comfortable.


  • Be independent and have an identity of yourself. You’ll be in a lurch, if the person (could be your manager) you are dependent on to speak for you, leaves the company.
  • Help all the people you can. When you fall down, you’ll have lot of hands to pull you back.
  • Talk less, Do more. Take initiatives to change the things you don’t like or that can be improved.
  • Read lot of books – non-fictional, management. It will help shape your outlook and attitude. Also don’t shy from reading self-help books.
  • Don’t judge or build perception. Instead try to know and reason out the situation to which he/she was subjected to.
  • Lastly you should follow your dreams. Don’t lose them. I mean literally too –> don’t lose your sleep over work! Work comes as soon as you finish it!!!


Hope it helps! It was an immense pleasure to share it with you all. Smile

Do share your own experiences and feedback!


Tags: , ,

General | Microsoft | Interviews | Personal | Self Help

Windows Phone “Mango” Features

by bhavikv 22. May 2011 18:32

Ps. I work for Microsoft, but I am no way associated with Windows Phone Team. I have no idea about the actual list of Features of WP7 “Mango” Update.

Here’s the list from NeoWinand WinRumors for ready reference.

Outlook Conversation View - Emails combined together in threads
Lync Messaging Client - Enterprise messaging client
Twitter integration - Tweets integration into people hub
Office 365 integration - Office 365 features built-in
Bing Vision - Scan QR, Microsoft Tags, books, CDs and DVDs
Bing Audio - Similar to Shazam, will identify songs
Windows Live Messenger integration - Integrated into the people hub and messaging hub
Facebook Chat integration - Integrated into the people hub and messaging hub
AOL Messenger integration - Integrated into the people hub and messaging hub
Contacts grouping - Create groups of contacts to send messages to
Xbox LIVE sync function - Sync function to likely sync settings/games across devices
Now playing artist information on lock screen - album art on the lock screen
Visual Voicemail support - Visual voicemail using same method as iOS/Android
Network awareness NCSI support - improvements for switching between networks/optimization
Internet Explorer 9 mobile - HTML5 support and hardware acceleration
Multitasking support - switch quickly between apps
Fast application resume - quickly resume recently used apps
Podcast support - download podcasts via the Marketplace
Turn-by-turn navigation in Bing Maps - voice guided directions and turn-by-turn
SMS dictation - Microsoft tellme dictates messages
East Asian Language keyboard support - additional language support
Handwriting and dictionary support - support for writing Chinese characters
Pin Outlook Folders - Pin folders as favorites inside Outlook
SkyDrive integration - Access SkyDrive documents from Office Hub
Kinect support for games - interact with Kinect and Xbox games from Windows Phone
Outlook email server search - search Exchange servers from Outlook client
Complex (alpha-numeric) password support - strong number and character password support
Information Rights Management - support for protecting e-mails and Office documents
Ringtone support - third party ringtone support
App list - automatically detect list, implemented jump list and search for apps
Marketplace search improvements - apps, podcasts, music separated for easy search
App install improvements - progress bar install UI
Search extras - User search actions can be connected to third-party apps
Motion Sensor - apps to use new gyroscope hardware
Background audio - apps can run audio in the background
File download service - third-party apps can download files from the web
Alarms - alarm notifications for third-party apps
Pin app features - Users can pin live tiles of deep app features in third-party apps
Zune Smart DJ mix - allows users to discover new music and save/create playlists
Camera sound toggle - users can now disable the camera shutter sound
WiFi improvements - support for hidden SSID networks

This list is impressive! I bet it can be released as WP8 Winking smile

Again this is not the confirmed list of features, so cant comment on it. But I am excited! Are you? Smile




Why you should care about WP7 development?

by bhavikv 3. November 2010 21:15


A lot of folks asked me – Why should I care about Windows Phone 7 (WP7) development? iPhone and Android are already the Market front runners, so why build for a very new platform?

I give you few reasons why you should care about WP7 Development -

1. It’s a different Phone! Not just another rip-off of the innovative Apple Screen. And BTW people are loving it!

2. Its built for efficiency

3. OEMs feel its easier to build WP7 phones

4. It uses XNA to develop for games, same framework used for developing XBox Games. So you can get your game run on 3 screens – Xbox, PC and WP7. Also many Game Studios like EA have committed to build games for WP7 platform.

5. Marketplace just has 1k applications – here’s the potential to earn money! Other platforms Marketplace being so filled with Apps (last heard of 250k apps in Apple Marketplace and some 100k apps in Android store), so selling your app through thousands of applications will be difficult.

6. All major apps and games like Shazam and Bejeweled available across iPhone and Android are available. Special apps for Kindle, Twitter, Netflix are already available in Market place.

7. It promises tight integration of Office, Bing Maps, Bing Search, Xbox, Facebook, Zune Music and Windows Live. It awesome with Hubs maintaining single view of multiple apps.

8. As a developer you also have an option to build Application using Silverlight. So put your existing C# skills to use to develop apps quickly. Ohh BTW, developing on WP7 is a LOT easier than developing on other platforms! (I am not sure of this, but this is what developers are saying on the web).

9. The developer tools(Visual Studio Express) are free. Unlike you need to buy Mac to develop for iOS.

10. Minimum-Specs for WP7 hint at High-end hardware. This means your application using features like Accelerometer and Camera will work perfectly on every WP7 device.

There might be few shortcomings of the platform (Copy-paste, Flash etc) but these should be ironed out in future releases. Smile

Did I also mention that Bill Gates is using WP7.

So what are you waiting for? Start developing for WP7 right away!




Free WP7 e-book and ‘31 days of WP7’

by bhavikv 31. October 2010 23:39

Hi All,

Just came across 2 useful resources for WP7 development.

1. Microsoft Press - Programming Windows Phone 7, by Charles Petzold.
The book has over 1000 pages covered in 24 chapters. Haven’t gone through the  complete contents of the book, but by a glance, this looks to be a comprehensive guide to WP7 development. Click here to know more and how to download the e-book.

2. Blog site - .
This blog gives a brief walkthroughs with screenshots about a concept. Very easy to understand and learn.

Hope it helps!



Windows Phone 7 Development

by bhavikv 2. October 2010 17:09

Hi All,

With Windows Phone 7 Developer tools being released last month, this presents you all an opportunity to develop and submit your apps to earn some cash Open-mouthed smile


To get ready with WP7 development, download the web installed for  Windows Phone 7 Developer Tools.  This will install Visual Studio 2010 Express for Windows Phone, the Windows Phone Emulator, Expression Blend 4 for Windows Phone, and XNA Game Studio 4.0.
So If you have Visual Studio 2010 already installed, this Developer tools will install the  necessary VS templates. Along with that, it’ll install the Visual Studio 2010 Express for Phone. The Express edition is completely free and you can develop exactly same applications irrespective of Express edition tag (you just need to register it once within 30 days). Note that an ISO is also available for complete download.

WP7 Development is very easy. You just need pre-requisite knowledge of C# for coding. If you are a fan of VB, don’t worry, VB for WP7 Developer Tools just got released as CTP and are available for download from here. You can chose 2 development paths for building your phone application – Silverlight for creating data centric apps and XNA for creating games. Though you can still create games using Silverlight and other apps with XNA, these frameworks are best built in interest of the developers.

Some Links to get started -

1. Scott Gu’s blog post on creating a sample Twitter Application.
2. Windows Phone 7 Developer Blog.
3. MSDN -
4. MSDN Samples -
5. Windows Phone 7 in 7 Minutes (videos) – This site is very good for getting an intro to various aspects of development. Check them first!
6. Windows Phone 7 Training Kit – contains sample projects and walkthroughs.
7. Channel 9 post – This contains many more sample links.
8. Jump Start Training – 12 part series to walk you through WP7 development.
9. Silverlight Toolkit for WP7 – additional controls.
10. Mobile Advertising SDK – to earn money from Ads.
11. Windows Phone 7 Design Guide ver 2 – Design principles for Metro UI.

As you’ll see, you don’t really need a Windows Phone to develop, the developer tools provide you with an emulator that simulated the exact phone behavior. So go ahead and start developing for WP7!

I’ll soon be posting my experiences and samples from WP7 Development.




Format XML in C#

by bhavikv 23. April 2010 13:24

Found an interesting link -

This is to format XML in C#. I have found it quite useful to view and analyze the XML returned from the Web Services.

/// <summary> 
/// Formats the provided XML so it's indented and humanly-readable. 
/// </summary> 
/// <param name="inputXml">The input XML to format.</param> 
/// <returns></returns> 
public static string FormatXml(string inputXml) 
    XmlDocument document = new XmlDocument(); 
    document.Load(new StringReader(inputXml)); 
    StringBuilder builder = new StringBuilder(); 
    using (XmlTextWriter writer = new XmlTextWriter(new StringWriter(builder))) 
        writer.Formatting = Formatting.Indented; 
    return builder.ToString(); 




IPL 3 – Mathematics for Semis

by bhavikv 18. April 2010 01:19

I and Sandy (Sandeep Kumar) got to the inside of the mathematics behind the top 4 slots for IPL 3 Semis after considering all possible outcomes (2*2*2) of the remaing 3 matches and the most likely impact on the Net Run Rate. This does brings out interesting facts.

Following is the current standings (as on 4/17)–>


Matches Points NRR
Mumbai Indians (MI) 13 20 1.251
Royal Challengers Bangalore (RCB) 14 14 0.219
Delhi Daredevils (DD) 13 14 0.066
Deccan Chargers (DC) 13 14 -0.363
Chennai Super Kings (CSK) 13 12 0.27
Kolkata Knight Riders (KKR) 13 12 -0.456
Rajasthan Royals (RR) 14 12 -0.514
Kings XI Punjab (KXIP) 13 8 -0.49

On Following are the analysis for each teams:

1. Mumbai Indians: They have already qualified for Semis and will pick up the 1st slot. The only unanswered question is whom do they play for Semis. They will see RCB if CSK wins against KXIP else they’ll see the losing team of DC and DD and with a very slight chance of seeing KKR.

2. Royal Challengers Bangalore: They are surely in Semis. The position now depends on CSK vs KXIP. If CSK win, RCB will take the 4th berth and play MI in Semis else they remain on 2nd berth and avoid MI in Semis.

3. Delhi Daredevils: If they win against DC, they take the 2nd berth. They can still qualify for the Semifinals provided CSK loses against KXIP. KKR shouldn’t pose problem since their runrate is quite high and they should try to maintain the run-rate while losing to DC.

4. Deccan Chargers: Same case as DD. If they win against DD, they take the 2nd berth. They can still qualify for the Semifinals provided CSK loses against KXIP but they should control the net run rate (while losing to DD) so that they don’t fall behind KKR and lose the semi-finals spot to them.

5. Chennai Super Kings: Couldn’t get more simple than this. CSK needs to win against KXIP to be in Semis. If they win, they’ll take up the 3rd Spot.

6. Kolkata Knight Riders: Chances are quite low, but still statistically possible. They do still need to beat MI (quite convincingly) and then hope that the winner of DC vs DD wins with a huge margin. Though looking at the present net run rate KKR should hope that DD wins against DC.

7. Rajasthan Royals: Well its THE-END for the team. No chances to play in Semis this year. :(

8. Kings XI Punjab: KXIP wont play the Semis, but they can still stop CSK from qualifying if they win against them.

To Reference follow the below table to check who’ll be the Top –4 teams and which are the teams playing Semis 1 and Semis 2.

KXIP vs CSK DD vs DC MI vs KKR Points table (top 4) Semi Final 1 Semi Final 2


Bhavik and Sandeep.

P.S.: Thanks to Ranjit Salvi (die hard fan of KKR) : this analysis was also done in a bid to prove that chances of KKR qualifying for Semis are even less than 1/8 (considering net run rate is a major factor). ;)

For Swayams query - Swayam Khialani :  bangalore can still (statistically) get knocked out if kolkata beat mumbai by a huge huge huge margin and if chennai beat kings 11... then it would be MI, DD/DC, Chennai, Kolkata in semis... btw, by how much does kolkata need to beat mumbai to stand a possible chance???

Our joint answer:

Considering your scenario: MI(1st spot), DD/DC Winner (2nd spot), Chennai (3rd spot) - Fixed!!

NRRs: CSK (considering a win) > 0.270; DD < 0.066 (if they lose), DC < -0.363 (if they lose); RCB = 0.219; KKR (current) -0.456

For KKR to win in this scenario, they have to beat the NRR of RCB to claim the 4th spot... The first 2 would be taken on the basis of points while the 3rd spot CSK would enjoy a NRR of > 0.270. So, KKR would require to make their NRR surpass 0.219 (of RCB). We have 2 cases.

Present NRR equation for KKR: (2009/255.3) - (2059/247.3) = -0.456

Case 1: KKR bats first and scores x runs (in 20 overs or gets all out before), Mumbai is restricted to y runs(in 20 overs or gets all out before)

New NRR value for KKR = ((2009+x)/275.3) - ((2059+y)/267.3) which needs to be > 0.219

Solving the inequality, (x-y) should be roughly > 160 runs (Whoa!!)

Case 2: MI bats first and scores x runs(in 20 overs or gets all out before); KKR scores (x+1) in y overs

New NRR value for KKR = ((2010+x)/(255.3+y)) - ((2059+y)/267.3) which needs to be > 0.219

This inequality is not solvable for positive values of x and y. This implies KKR cannot achieve the reqd. NRR.

Conclusion: KKR will need to bat first !!! Hope Ganguly realises this maths before he walks in for the toss!!! ;)