Skip to content

langversion 6 is not recognized with msbuild or csc compiler in VS 2017 #539

Closed
@den-run-ai

Description

@den-run-ai

CSC : error CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default

Click to expand
python setup.py install
running install
running bdist_egg
running egg_info
writing pythonnet.egg-info\PKG-INFO
writing top-level names to pythonnet.egg-info\top_level.txt
writing dependency_links to pythonnet.egg-info\dependency_links.txt
reading manifest file 'pythonnet.egg-info\SOURCES.txt'
writing manifest file 'pythonnet.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_ext
Checking for updates from https://www.nuget.org/api/v2/.
Currently running NuGet.exe 4.3.0.
NuGet.exe is up to date.
MSBuild auto-detection: using msbuild version '15.3.409.57025' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
All packages listed in packages.config are already installed.
Scanning for projects...
MSBuild auto-detection: using msbuild version '15.3.409.57025' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin'.
Found 2 projects with a packages.config file. (clrmodule.csproj, Python.EmbeddingTest.csproj)
Feeds used:
  https://api.nuget.org/v3/index.json
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\



Attempting to gather dependency information for multiple packages with respect to project 'C:\Users\denis.akhiyarov\Downloads\pythonnet\src\clrmodule\clrmodule.csproj', targeting '.NETFramework,Version=v4.0'
Gathering dependency information took 694.65 ms
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Resolution was successful but resulted in no action
There are no new updates available.
No package updates are available from the current package source for project 'C:\Users\denis.akhiyarov\Downloads\pythonnet\src\clrmodule\clrmodule.csproj'.
Executing nuget actions took 5.2 ms
Feeds used:
  https://api.nuget.org/v3/index.json
  C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\



Attempting to gather dependency information for multiple packages with respect to project 'C:\Users\denis.akhiyarov\Downloads\pythonnet\src\embed_tests\Python.EmbeddingTest.csproj', targeting '.NETFramework,Version=v4.0'
Gathering dependency information took 180.1 ms
Attempting to resolve dependencies for multiple packages.
Resolving dependency information took 0 ms
Resolving actions install multiple packages
Retrieving package 'NUnit 3.8.1' from 'nuget.org'.
Retrieving package 'NUnit.ConsoleRunner 3.7.0' from 'nuget.org'.
  GET https://api.nuget.org/v3-flatcontainer/nunit/3.8.1/nunit.3.8.1.nupkg
  GET https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.7.0/nunit.consolerunner.3.7.0.nupkg
Removed package 'NUnit.ConsoleRunner 3.6.0' from 'packages.config'
Successfully uninstalled 'NUnit.ConsoleRunner 3.6.0' from Python.EmbeddingTest.csproj
  OK https://api.nuget.org/v3-flatcontainer/nunit.consolerunner/3.7.0/nunit.consolerunner.3.7.0.nupkg 52ms
Installing NUnit.ConsoleRunner 3.7.0.
Removed package 'NUnit 3.6.0' from 'packages.config'
Successfully uninstalled 'NUnit 3.6.0' from Python.EmbeddingTest.csproj
  OK https://api.nuget.org/v3-flatcontainer/nunit/3.8.1/nunit.3.8.1.nupkg 144ms
Installing NUnit 3.8.1.
Adding package 'NUnit.3.8.1' to folder 'C:\Users\denis.akhiyarov\Downloads\pythonnet\packages'
Added package 'NUnit.3.8.1' to folder 'C:\Users\denis.akhiyarov\Downloads\pythonnet\packages'
Added package 'NUnit.3.8.1' to 'packages.config'
Successfully installed 'NUnit 3.8.1' to Python.EmbeddingTest.csproj
Adding package 'NUnit.ConsoleRunner.3.7.0', which only has tools group, to project 'Python.EmbeddingTest.csproj'
Adding package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\denis.akhiyarov\Downloads\pythonnet\packages'
Added package 'NUnit.ConsoleRunner.3.7.0' to folder 'C:\Users\denis.akhiyarov\Downloads\pythonnet\packages'
Added package 'NUnit.ConsoleRunner.3.7.0' to 'packages.config'
Successfully installed 'NUnit.ConsoleRunner 3.7.0' to Python.EmbeddingTest.csproj
Executing nuget actions took 1.61 sec
Microsoft (R) Manifest Tool version 10.0.10011.16384
Copyright (c) Microsoft Corporation 2012.
All rights reserved.
Microsoft (R) Build Engine version 4.7.2046.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Microsoft (R) Build Engine version 4.7.2046.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

CSC : error CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default [C:\Users\denis.akhiy
arov\Downloads\pythonnet\src\runtime\Python.Runtime.csproj]
CSC : error CS1617: Invalid option '6' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default [C:\Users\denis.akhiy
arov\Downloads\pythonnet\src\clrmodule\clrmodule.csproj]
Traceback (most recent call last):
  File "setup.py", line 417, in <module>
    zip_safe=False,
  File "C:\Python\Python27-32\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python\Python27-32\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "C:\Python\Python27-32\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python\Python27-32\lib\site-packages\setuptools\command\install.py", line 67, in run
    self.do_egg_install()
  File "C:\Python\Python27-32\lib\site-packages\setuptools\command\install.py", line 109, in do_egg_install
    self.run_command('bdist_egg')
  File "C:\Python\Python27-32\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python\Python27-32\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python\Python27-32\lib\site-packages\setuptools\command\bdist_egg.py", line 161, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "C:\Python\Python27-32\lib\site-packages\setuptools\command\bdist_egg.py", line 147, in call_command
    self.run_command(cmdname)
  File "C:\Python\Python27-32\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python\Python27-32\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python\Python27-32\lib\distutils\command\install_lib.py", line 92, in run
    self.build()
  File "C:\Python\Python27-32\lib\distutils\command\install_lib.py", line 111, in build
    self.run_command('build_ext')
  File "C:\Python\Python27-32\lib\distutils\cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "C:\Python\Python27-32\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "C:\Python\Python27-32\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "C:\Python\Python27-32\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self.build_extension(ext)
  File "setup.py", line 225, in build_extension
    subprocess.check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
  File "C:\Python\Python27-32\lib\subprocess.py", line 186, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '"C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" pythonnet.sln /p:Configuration=ReleaseWin /p:Platform=x86 /p:DefineConstants="PYTHON27%3BPYTHON2%3BUCS2" /p:PythonBuildDir="C:\Users\denis.akhiyarov\Downloads\pythonnet\build\lib.win32-2.7" /p:PythonInteropFile="interop27.cs" /verbosity:minimal /p:PythonManifest="C:\Users\denis.akhiyarov\Downloads\pythonnet\build\lib.win32-2.7\app.manifest" /t:Build' returned non-zero exit status 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions