Search Unity

Unity Project Didn’t Transfer to Visual Studio 2017?

Discussion in 'Code Editors & IDEs' started by Stats3D, Apr 20, 2017.

  1. Stats3D

    Stats3D

    Joined:
    Jan 31, 2017
    Posts:
    8
    I upgraded to Unity 5.6.0f3, including Visual Studio 2017.

    I tried to complete an IL2CPP compilation. But when I open the project in VS 2017, nothing works and I get this message:

    /.vcxproj : warning : The build tools for Visual Studio 2015 (v140) cannot be found. Install Visual Studio 2015 (v140) to build using the Visual Studio 2015 (v140) build tools.

    (When I try to build the project, I get a bunch of other errors, including one saying “GameAssembly.dll” can’t be found.)

    I checked the .vcxprj file and I found this line:

    <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

    As far as I know, this refers to Visual Studio 2015. In other words, it seems to me that the Unity output is directing Visual Studio to the 2015 version.

    I transferred this Unity project from my older Unity version, and I'm wondering if some old settings got carried over.

    Do I need to install Visual Studio 2015, or are there some settings I need to change to use VS 2017?
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,537
    Edit>Preferences>External Tools>External Script Editor
     
  3. Stats3D

    Stats3D

    Joined:
    Jan 31, 2017
    Posts:
    8
    Thank you, but I just tried that and the output -- including the errors -- is the same.

    My understanding is that Edit>Preferences>External Tools>External Script Editor refers to the tool used to edit code.

    My issue is with the compilation target.
     
  4. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,537
    So are you having problems creating a Build of the Project through Unity or compiling some dll in VS2017?
     
  5. Stats3D

    Stats3D

    Joined:
    Jan 31, 2017
    Posts:
    8
    As far as I can tell, the problem appears to be with a setting in the Unity build.

    My Unity IL2CPP build seems to set the compilation target as VS 2015, when my Unity version is installed to work with VS 2017. Visual Studio 2017 then rejects the Unity build files, telling me I need to install VS 2015.

    Here is the question: When Unity 5.6.0f3 delivers an IL2CPP build, are those files supposed to be compiled in VS 2015 or VS 2017?

    --------------

    Edited to add: When I talk about Visual Studio 2015 vs. 2017, I am referring to Platform Toolset v140 vs. v141.

    I could install VS 2015 in addition to VS 2017, but it would be nice to make sure that this is what Unity intended with IL2CPP.
     
    Last edited: Apr 20, 2017
  6. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,537
    They are compiled in mono, which doesn't have anything to do with vs. Projects are built and compiled through unity/mono, not vs.