Moving to VS 2015 from VS 2013


The folks on the Visual Studio team have been making it increasingly easier to move from version-to-version with less impact on our projects. In this post I’m going to examine the process of moving from Visual Studio 2013 to Visual Studio 2015.

In this series we’re working through the conversion of an MVC 5-based application and migrating it to MVC 6. You can track the entire series of posts from the intro page.

The Backstory

First, a bit about our application. I said this was a real-world application, and it is. You can clone the repo and run it locally if you like.

image

What we have is an expense report application, albeit a little on the light side for features. No worries, though, that is the intent! But the real pieces of an application sporting Onion Architecture are in place, and there’s quite a bit of commonly-used tech in this bad boy that you would likely find in any real-world app:

  • imageSeparate projects for separate concerns
  • A UI Project that stands with only a single reference (to Core)
  • An older version of NHibernate
  • Unit tests
  • HTTP Handlers
  • The Bootstrap CSS/JS library
  • StructureMap for dependency injection
  • A database migrations library
  • A custom workflow engine

So, this is no File –> New –> Project here, this is the real deal.

First Steps

The first issue we’re going to address is the fact that our solution and project are currently in VS 2013 “mode”.  In the past, you’d likely have to walk through some kind of conversion process and this was usually a compelling enough reason for people to back delay an upgrade. Did you ever have issues with incorrect file paths, incompatible project type identifiers, broken project references and builds broken due to missing dependencies? At times, I’ve even had to resort to manually editing the solution and project files to get a project back online.  Thankfully, this is nothing like that. There is nothing major we need to do in order to get our project open in Visual Studio 2015, just load the solution from disk.

In the case of Bootcamp, our project opens cleanly and builds as we would expect. But you’ll notice right away a change in the repo.

image

Visual Studio 2015 runs IIS Express in a more specific context than previous versions, which is a huge win. The applicationhost.config is basically everything you need to get the web server up locally while you develop, debug and test, and it replaces what we would used to use for IIS Express for machine-wide configuration.

This file also happens to be in the .vs directory, used only for devs running Visual Studio on Windows. It’s also easily regenerated for other developers and we don’t need to check it into source control, lest we be endlessly trumping each others’ local changes. Instead of any project or solution modifications, we’re instead going to modify the .gitignore file, adding the following line:

**/src/.vs/

Great stuff! Easy, and we’re running in the latest version of everyone’s favorite IDE. We haven’t yet made any project structure changes, haven’t targeted any new .NET bits, but now we’re ready to start those pieces.

The pull request for this post can be reviewed here.

Pro tip: To get your solution to open in Visual Studio 2015 by default, instead of Visual Studio 2013, you can simply update the first few lines of your .sln file to include the following:
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0

Next Steps

I’ve been running different incarnations of VS 2015 on my machine alongside Visual Studio 2013 (and for a period, VS 2010 as well) without any gotchas. There are some great new features that are worth checking out (it’s a long list), and your team may be able to leverage them.

While this is a short and single-focused post, I hope you see that opening the project in VS 2015 may yield no negative side effects. Heck, if you’re not sure you want to try it on your metal, you can even jump on a free trial of Azure and attempt to open your project on a VM running 2015.

Happy coding! Smile


Comments (10)

  1. Michael Greenspan says:

    Great, thanks for the information! Looking forward to the next part.

  2. George says:

    Thanks for this. I've been hesitant to try and convert my solution over to VS 2015. Now I'm going to give it a shot.

  3. Carl says:

    VS2015 is great with many new features but still really buggy.  Especially with the forms designer and TFS integration.

  4. David Marcus says:

    I have not yet seen a definitive statement of whether the VS 2015 solution and project files are backward compatible with VS 2013.

    Please confirm that they are!

  5. Yogesh says:

    Yes I agree with most part, but I found out the hard way after upgrading my solution that there is no support for Crystal Report in VS 2015 yet.

  6. Benny Tordrup says:

    What about native C++ projects?

  7. Mahesh says:

    Good job sir for giving valuable information about vs15

  8. Justin says:

    Had problems with MVC 4 projects in VS 2015, not recognizing the syntax…

  9. James Chambers says:

    @David Marcus – yes, I have gone back and forth between 2013 and 2015. What you have to remember is that the xproj type is not supported in 2013, and if you use third-party components you may need to update those.

    @Benny Tordup – I'm not a c++ dev, but yes it looks like it. You can read more about it here: blogs.msdn.com/…/visual-studio-2015-rtm-now-available.aspx

    @Justin – What are you seeing? I'm running an MVC4 app in VS2015 with no problems. Is it compile time? Razor issues?

  10. Brooke Shieh says:

    that vs2013 convert to vs2015 are very comfortable

Skip to main content