Wednesday, 9 September 2015

Visual Studio 2015 - Open Old/Migrated Solution Creates Backup Folder Continuously

I was in the process of migrating over to Visual Studio 2015 from Visual Studio 2013. When I executed a local command line build, I received the following error.

Microsoft Visual Studio 2015 Version 14.0.23107.0.
Copyright (C) Microsoft Corp. All rights reserved.
Solution file 'xyz.sln' is from a previous version of this application and must 
be migrated in order to build in this version of the application. 
To migrate the solution, open the solution in this version of the application.
Migration completed successfully, but some warnings were detected during migration.
For more information, see the migration report:  UpgradeLog06.htm
I opened the solution using Visual Studio 2015, and got the migration report. I performed the solution clean followed by solution rebuild and everything works fine. On closing the solution, and performing a local command line build again I got the same error message.
Every time I open the solution using VS 2015 a new "Backup" folder is created with iteration and a new migration report is displayed.
The migration report shows 8 projects that have the following 5 warnings.

Visual Studio needs to make non-functional changes to this project in 
order to enable the project to open in Visual Studio 2015, Visual Studio 2013, 
Visual Studio 2012, and Visual Studio 2010 SP1 without impacting project behavior
The solution I was opening in Visual studio 2015 has around 35 projects and every-time a backup folder is created, it takes space in disk and the make changes in solution file. It was quite a hassle to check-in solution file to source control with backup folder information. So I started digging around how to stop this backup folder nonsense, and after some soul searching I finally fixed it.

Here is the solution:
- Firstly, open your project file (.csproj) in text editor.
- Find the following two lines as shown in the image and delete them.

- Then save the solution file.
Now, open your file in visual studio 2015 again. No more new backup folders and migration reports. It is safe to delete the old backup folders(s) and associated HTML file(s).

/Adnan

5 comments :

  1. I guess you mean project file (.csproj) rather than solution (.sln) file. Otherwise works great, thanks!

    ReplyDelete
  2. Good one. as the previous post says the change is in the .csproj file

    thanks

    ReplyDelete
  3. Great ! .. Worked for me.

    The '.csproj' file should be edited rather than '.sln' file.
    The edit should be done in every project's '.csproj' file, which shows up on the Migration Report page in browser.

    Any idea what is causing this issue ?

    Thanks Adnan Zameer.


    [SHAH ZAMAN]

    ReplyDelete
  4. Can I delete the old Backup folders and associated html files?

    ReplyDelete
    Replies
    1. Sure go ahead delete the folders .. they are useless anyway :)

      Delete