Chlodny series Day 14: Web Api Upgrade from beta to RC

Over the weekend I finished upgrading the initial parts of the Chlodny Web Api project along with the past blog post of this series.  This post will go over the process I needed to do in order to upgrade from Web Api Beta to Web Api RC.

First issue I ran into was that the Nuget packages did not upgrade from Beta to RC.  I found many different ways online to resolve this issue.  In the end I found it the easiest to do the following.

  1. Open the packages folder and delete everything.
  2. Start in the Data Access project and upgrade the package.

The next thing I ran into for an error was that generic HttpResponseMessage’s were removed. I personally think the new format is a nice change.

The old format looked something like this:

new HttpResponseMessage<someGenericCollection>(someValue)

The new format should look something similar to this:

Request.CreateResponse(HttpStatusCode.OK, someMessage)

 

The final upgrade issue I ran into was the removal of GetUserPrincipal.  It was changed to System.Threading.Thread.CurrentPrincipal.Identity.

 

Note: As Larry pointed out in the comments his is also exposed to the APIController and is accessible by this.User.Identity 

Advertisements
This entry was posted in MVC, Web and tagged , , , , . Bookmark the permalink.

4 Responses to Chlodny series Day 14: Web Api Upgrade from beta to RC

  1. Larry A says:

    FYI. User is now exposed off of ApiController. So you can do this.User.Identity inside your ApiController.

  2. chadit says:

    thanks for the comment, I updated the post to include that.

  3. mkamosk says:

    Dear Author —
    Thanks for the great post. Here are a few notes from our end.
    For the “packages.config” files in each project, we had to also delete everything EXCEPT the root node– and found that if we cleared that file entirely NuGet would not work.
    We had purged all the files in our NuGet “packages” folder but did it with Perforce which did not delete the folder, it left empty folders there and, we found, that having empty folders makes NuGet Package Manager Console break– so we had to delete the folders too.
    Thanks.
    — Mark Kamoski

    • chadit says:

      I have my projects setup to auto restore NuGet packages. Maybe that is why I did not run into those other issues. Thanks for the extra info, I marked that down to watch out for in the future.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s