0

I wrote some code for class on my desktop at home which has microsoft visual studio 2015 desktop but when I download it from google drive to my laptop for class I can't compile or test my code. I get an error in the picture below.

I have microsoft visual studio 2013 express on my laptop and emailed my teacher for help on how to solve it. She directed me to a solution in this link Visual Studio 2013 error MS8020 Build tools v140 cannot be found which I followed but does not work for me.

Is there a way to resolve this? Or do I need to write it from scratch?

Community
  • 1
  • 1
Callat
  • 2,928
  • 5
  • 30
  • 47
  • 2
    Are you attempting to open a VS Studio 2015 project in VS Studio 2013 and expect it to build? That's usually not going to work. If you took just the source code and created a new project, it has a better chance of working. – TriskalJM Mar 22 '16 at 17:22
  • Yes @TriskalJM that is what I am trying to do. I tried your method I opened a new project in vs 2013 and copied the code from the cpps,.h etc into new files and tried to compile it and I still get the same error. You say that this usually does not work. Can you explain why? I'm not using any high level stuff as I'm only in the second semester of the computer science program at my university. – Callat Mar 22 '16 at 17:24
  • 2
    Only thing I can think to do is reinstall VS 2013. Have you had multiple versions of VS on your laptop? They're notorious for not playing well together. Uninstalls and reinstalls can put the machine into weird states. – TriskalJM Mar 22 '16 at 17:26
  • I have visual studio 2013 express and last night I went ahead and installed 2015-desktop as well but I did not uninstall 2013 yet. I'm slightly afraid to because all the code I've previously written is done by 2013 so if I lose it does that mean I can't go back and optimize any of my old code? – Callat Mar 22 '16 at 17:35
  • What versions of the .NET framework does the Control Panel say are installed? It's possible that the installation of 2015-desktop ninja-uninstalled the framework that came with 2013. – TriskalJM Mar 22 '16 at 17:37
  • You can have multiple versions of VS installed simultaneously - for example, I have 2008, 2010, 2012, 2013 and 2015 all installed, no problems. However, uninstalling VS doesn't mean that you'll lose your code, just the ability to compile with that version of VS. – MuertoExcobito Mar 22 '16 at 17:42

1 Answers1

2

You need to change the target toolset for your project (more information here). Generally newer toolset versions cannot be used in older Visual Studio versions, however, older toolsets can be used in newer Visual Studios. So, you need to set the toolset to the oldest version you will be using.

Go to the project properties for your project, and in the General tab, change the Platform Toolset to Visual Studio 2013 (v120), and your project should work in both VS2013 and VS2015.

MuertoExcobito
  • 9,741
  • 2
  • 37
  • 78
  • When I click Project -> Properties I'm navigated to a new window. There I clicked Configuration Properties -> General and found "Platform Toolset". When I click the arrow to expand. I only see two windows phone 8.0(v110_wp80) and . I tried them in order and neither worked, but after clicking the second one I got two other options Visual Studio 2013(v120) and Visual Studio 2013 - Windows XP(v120_xp). Again I tried them in order and neither worked the error persists. I changed the configuration and platform boxes at the top and for some reason it worked. – Callat Mar 23 '16 at 16:52