diff --git a/setup.py b/setup.py index 0c28a80f5..1b6f07ea6 100644 --- a/setup.py +++ b/setup.py @@ -329,9 +329,16 @@ def _install_packages(self): self.debug_print("Updating NuGet: {0}".format(cmd)) subprocess.check_call(cmd, shell=use_shell) - cmd = "{0} restore pythonnet.sln -MSBuildVersion 14 -o packages".format(nuget) - self.debug_print("Installing packages: {0}".format(cmd)) - subprocess.check_call(cmd, shell=use_shell) + try: + # msbuild=14 is mainly for Mono issues + cmd = "{0} restore pythonnet.sln -MSBuildVersion 14 -o packages".format(nuget) + self.debug_print("Installing packages: {0}".format(cmd)) + subprocess.check_call(cmd, shell=use_shell) + except: + # when only VS 2017 is installed do not specify msbuild version + cmd = "{0} restore pythonnet.sln -o packages".format(nuget) + self.debug_print("Installing packages: {0}".format(cmd)) + subprocess.check_call(cmd, shell=use_shell) def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False): """Return full path to one of the Microsoft build tools"""