Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8976541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:10:13+00:00 2026-06-15T19:10:13+00:00

I’m baffled why this works on my development server (using IIS Express) and not

  • 0

I’m baffled why this works on my development server (using IIS Express) and not on the production server (Win2K8 R2 + IIS 7.5).

I have a very simple WebAPI controller method:

 public HttpResponseMessage Get(string notificationType = "all", int skip=0, int take=25) {
        Trace.WriteLine(String.Format("Hello, world! From NotifcationsController#Get notificationType={0} skip={1} take={2}", notificationType, skip, take));   
        Trace.WriteLine(String.Format("And furthermore, HttpContext.Current.Request[notificationType]={0}", HttpContext.Current.Request["notificationType"]));
        Trace.WriteLine(String.Format("And finally, HttpContext.Current.Request.QueryString[notificationType]={0}", HttpContext.Current.Request.QueryString["notificationType"]));
      ...
 }

On the development server at http://localhost:1398/api/notifications?notificationType=comments, things work. I see this in trace.axd:

 Trace Information
 Category   Message From First(s)   From Last(s)
 Hello, world! From NotifcationsController#Get notificationType=comments skip=0 take=25     
 And furthermore, HttpContext.Current.Request[notificationType]=comments
 And finally, HttpContext.Current.Request.QueryString[notificationType]=comments

But when hitting this controller at http://api.nameofmywebsite.com/api/notifications?type=comments I see this in trace.axd:

 Trace Information
 Category   Message From First(s)   From Last(s)
 Hello, world! From NotifcationsController#Get notificationType=all skip=0 take=25
 And furthermore, HttpContext.Current.Request[notificationType]=    
 And finally, HttpContext.Current.Request.QueryString[notificationType]=

 ...

 Querystring Collection
 Name   Value
 type   comments

This seems very, very bizarre to me. Based on what’s in trace.axd, it sure doesn’t seem to be a routing issue… it’s hitting the correct controller and action.

Why isn’t the querystring parameter getting mapped to the parameter of the controller action in the production environment!?

For whatever it’s worth, I’m using the same web.config on both development and server. I can’t think what configuration differences would cause this difference…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:10:14+00:00Added an answer on June 15, 2026 at 7:10 pm

    I’m a moron.

    This wasn’t working because I was hitting “notifications?type=comments” on the production server and not “notifications?notificationType=comments”

    The method parameter name has to match the querystring parameter name for binding to happen. I knew that, but didn’t realize I was passing in the wrong querystring parameter name! What happened is that I changed the method parameter name a few weeks ago, forgot it in the meantime, and didn’t realize the browser’s autocomplete function supplied me with a history match that contained the old parameter name.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I have thousands of HTML files to process using Groovy/Java and I need to
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.