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.
- Open the packages folder and delete everything.
- 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
FYI. User is now exposed off of ApiController. So you can do this.User.Identity inside your ApiController.
thanks for the comment, I updated the post to include that.
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
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.