This may be my lack of formal knowledge about the VS 2015 environment but I was unable to get many of the non-2015 examples for Visual Studio to compile no matter what I did with the settings, property pages, etc. After a ton of investigation and brute-force I can only assume that 2015 doesn’t really do a great job at re-targeting, or I just can’t find the right combination of settings in the IDE to re-target properly. Following is the example of the issue newbies may encounter and my brute-force method to quickly move an example to 2015. After I figured out this process I was able to move all examples to 2015 within about 10 minutes. This post assumes you have no previous VS environments and are starting with a clean-slate of VS 2015 on your machine.
Problem: If you attempt to open a 2013 or previous solution in 2015 you are met with a dialog stating that the solution needs to be upgraded. If you agree to the upgrade then attempt to compile the project you will likely get the MSB8020 error. The solution upgrade was supposed to re-point your build options to v140 of VS and when you look at all of the visible settings it shows this was accomplished… but that same error just keeps smacking you on builds. Searching the web you’ll be met with a host of potential solutions from pre-build command line options to property page tweaks.
It appears however that any references within the actual 2013 project file itself do not get upgraded and override the property page settings. Note the version the project is set for from the errors list (likely v120 for 2013, v110 for 2010, etc)
20xx to 2015 Brute-Force upgrade
- Open Visual Studio 2015
- Select File->Open Project and navigate to the \examples\audio plug in host\builds folder
- Right mouse click the VisualStudio20xx folder to upgrade and select Copy then right mouse again and select Paste
- Right mouse click the VisualStudio20xx - Copy folder and rename followed by changing the name to VisualStudio2015
- Double click the folder and select the solution (sln) file.
- You will be prompted to upgrade the solution/project. Go ahead and accept that option. This will upgrade your user property pages (you can learn more about that as you move forward with VC)
- File-Save the solution then File-Close solution
- External to VS open the vcx.proj file from the 2015 folder in a suitable text editor
- Search and Replace all instances of v120 with v140 (there are usually 2-4 entries) then save the file
- Now reopen the 2015 solution in VS and you’re ready to go.
Again, this is only a proven brute-force method I came up with due to my frustration with the IDE not complying with all the fixes I found on the web. Hope it helps other newbies get a jump start.