Skip to content

Win10 VS2015 syntax error at token '.field' in: .field static assembly initonly int64 [reopen] #220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chunyisong opened this issue May 27, 2016 · 27 comments

Comments

@chunyisong
Copy link

chunyisong commented May 27, 2016

Hi,it raises errors when i rebuild clrmodule.The build env and config is :
window10 Visual Studio 2015 , Release Win x86 , add "PYTHON35, UCS2" compilation symbols to both Python.Runtime and clrmodule projects
The error is:
2> clrmodule -> H:\docs\python\pythonnet-master\src\clrmodule\bin\x86\ReleaseWin\clrmodule.dll
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.6\tools\RGiesecke.DllExport.targets(42,5): error : Microsoft.Build.Utilities.ToolLocationHelper could not find ildasm.exe.
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.6\tools\RGiesecke.DllExport.targets(42,5): error : C:\Users\scy\AppData\Local\Temp\tmpF161\clrmodule.il(62) : error : syntax error at token '.field' in: .field static assembly initonly int64 'D43BE459642EEF2653B9DF1524152974360EA4C5' at I_00002C9C

The rebuild output is :
1>------ Rebuild All started: Project: Python.Runtime, Configuration: ReleaseWin x86 ------
1>H:\docs\python\pythonnet-master\src\runtime\assemblymanager.cs(206,37,206,38): warning CS0168: The variable 'e' is declared but never used
1> Python.Runtime -> H:\docs\python\pythonnet-master\src\runtime\bin\x86\ReleaseWin\Python.Runtime.dll
2>------ Rebuild All started: Project: clrmodule, Configuration: ReleaseWin x86 ------
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "MinimumRecommendedRules.ruleset".
2> clrmodule -> H:\docs\python\pythonnet-master\src\clrmodule\bin\x86\ReleaseWin\clrmodule.dll
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.6\tools\RGiesecke.DllExport.targets(42,5): error : Microsoft.Build.Utilities.ToolLocationHelper could not find ildasm.exe.
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.6\tools\RGiesecke.DllExport.targets(42,5): error : C:\Users\scy\AppData\Local\Temp\tmpF161\clrmodule.il(62) : error : syntax error at token '.field' in: .field static assembly initonly int64 'D43BE459642EEF2653B9DF1524152974360EA4C5' at I_00002C9C
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.6\tools\RGiesecke.DllExport.targets(42,5): error :
3>------ Rebuild All started: Project: Python.Test, Configuration: ReleaseWin x86 ------
3>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "MinimumRecommendedRules.ruleset".
3>H:\docs\python\pythonnet-master\src\testing\eventtest.cs(26,41,26,54): warning CS0067: The event 'EventTest.InternalEvent' is never used
3>H:\docs\python\pythonnet-master\src\testing\eventtest.cs(28,40,28,52): warning CS0067: The event 'EventTest.PrivateEvent' is never used
3>H:\docs\python\pythonnet-master\src\testing\eventtest.cs(20,47,20,65): warning CS0067: The event 'EventTest.PrivateStaticEvent' is never used
3>H:\docs\python\pythonnet-master\src\testing\eventtest.cs(18,48,18,67): warning CS0067: The event 'EventTest.InternalStaticEvent' is never used
3> Python.Test -> H:\docs\python\pythonnet-master\src\testing\bin\x86\ReleaseWin\Python.Test.dll
4>------ Rebuild All started: Project: Python.EmbeddingTest, Configuration: ReleaseWin x86 ------
4>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "MinimumRecommendedRules.ruleset".
4> Python.EmbeddingTest -> H:\docs\python\pythonnet-master\src\embed_tests\bin\x86\ReleaseWin\Python.EmbeddingTest.dll
5>------ Rebuild All started: Project: Console, Configuration: Release x86 ------
5>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "MinimumRecommendedRules.ruleset".
5>H:\docs\python\pythonnet-master\src\console\assemblyinfo.cs(13,35,13,64): warning CS0618: 'SecurityAction.RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.'
5> Console -> H:\docs\python\pythonnet-master\src\console\bin\x86\Release\nPython.exe
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========
image
I don't know much about C# and visual studio.Thank you very much for helping solving this problem.

@chunyisong
Copy link
Author

I find the same issue #216 ,so close this .

@chunyisong chunyisong changed the title window10 Visual Studio 2015 clrmodule build error window10 Visual Studio 2015 clrmodule build error [Closed to watch #216] May 27, 2016
@den-run-ai
Copy link
Contributor

den-run-ai commented May 27, 2016

@chunyisong you can install PyPi wheels (pip install pythonnet), any reason why you need to recompile the source code locally?

Please re-open this issue, since your error is different from #216:

error : syntax error at token '.field' in: .field static assembly initonly int64

Next is did you add PYTHON35 compilation flag to both Python.Runtime and clrmodule projects? Right now you have to do this manually.

@chunyisong chunyisong changed the title window10 Visual Studio 2015 clrmodule build error [Closed to watch #216] window10 Visual Studio 2015 clrmodule build error [reopen] May 27, 2016
@chunyisong
Copy link
Author

@denfromufa I add "PYTHON35, UCS2" compilation symbols to both Python.Runtime and clrmodule projects ,but same errors occur!
Now I am using pythonnet-2.1.0-cp35-cp35m-win32.whl from PyPi,but I want to build pythonnet myself。I don't kown much about C# and VS,so I wish someoen help solve the problem.
Thanks for help and for the pythonnet project!
I reopen the issue.

@chunyisong chunyisong reopened this May 27, 2016
@den-run-ai
Copy link
Contributor

@chunyisong can you try to update unmanaged exports to 1.2.7?

see here:

#206

also can you try to build pythonnet from python side (not in Visual Studio), see instructions here:

python.exe setup.py bdist_wheel

https://github.com/denfromufa/pythonnet/wiki/Troubleshooting-FAQ

@den-run-ai
Copy link
Contributor

i tried building on windows 10, vs 2015 pro update 1, python35, release x86 and I do not get your error!

So please report: exact windows build number, vs 2015 full version number and license type (community, pro, express, etc.), .NET version.

@chunyisong
Copy link
Author

@denfromufa
I update unmanaged exports to 1.2.7.In addition, I find 1.2.7 can work if I replace "UnmanagedExports.1.2.6" with "UnmanagedExports.1.2.7" in file clrmdule/clrmodule.csproj .Then I rebuild and get "syntax error at token '.field' " .The output is:
1>------ Rebuild All started: Project: Python.Runtime, Configuration: ReleaseWin x86 ------
1>H:\docs\python\pythonnet-master\src\runtime\assemblymanager.cs(206,37,206,38): warning CS0168: The variable 'e' is declared but never used
1> Python.Runtime -> H:\docs\python\pythonnet-master\src\runtime\bin\x86\ReleaseWin\Python.Runtime.dll
2>------ Rebuild All started: Project: clrmodule, Configuration: ReleaseWin x86 ------
2>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "MinimumRecommendedRules.ruleset".
2> clrmodule -> H:\docs\python\pythonnet-master\src\clrmodule\bin\x86\ReleaseWin\clrmodule.dll
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.targets(58,3): error : C:\Users\scy\AppData\Local\Temp\tmp70B8\clrmodule.il(65) : error : syntax error at token '.field' in: .field static assembly initonly int64 'D43BE459642EEF2653B9DF1524152974360EA4C5' at I_00002DE0
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.targets(58,3): error :
3>------ Rebuild All started: Project: Python.Test, Configuration: ReleaseWin x86 ------
3>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "MinimumRecommendedRules.ruleset".
3>H:\docs\python\pythonnet-master\src\testing\eventtest.cs(20,47,20,65): warning CS0067: The event 'EventTest.PrivateStaticEvent' is never used
3>H:\docs\python\pythonnet-master\src\testing\eventtest.cs(26,41,26,54): warning CS0067: The event 'EventTest.InternalEvent' is never used
3>H:\docs\python\pythonnet-master\src\testing\eventtest.cs(18,48,18,67): warning CS0067: The event 'EventTest.InternalStaticEvent' is never used
3>H:\docs\python\pythonnet-master\src\testing\eventtest.cs(28,40,28,52): warning CS0067: The event 'EventTest.PrivateEvent' is never used
3> Python.Test -> H:\docs\python\pythonnet-master\src\testing\bin\x86\ReleaseWin\Python.Test.dll
4>------ Rebuild All started: Project: Python.EmbeddingTest, Configuration: ReleaseWin x86 ------
4>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "MinimumRecommendedRules.ruleset".
4> Python.EmbeddingTest -> H:\docs\python\pythonnet-master\src\embed_tests\bin\x86\ReleaseWin\Python.EmbeddingTest.dll
5>------ Rebuild All started: Project: Console, Configuration: Release x86 ------
5>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file "MinimumRecommendedRules.ruleset".
5>H:\docs\python\pythonnet-master\src\console\assemblyinfo.cs(13,35,13,64): warning CS0618: 'SecurityAction.RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.'
5> Console -> H:\docs\python\pythonnet-master\src\console\bin\x86\Release\nPython.exe
========== Rebuild All: 4 succeeded, 1 failed, 0 skipped ==========

image

if I run command " python.exe setup.py bdist_wheel ",the Error is much the same:
running bdist_wheel
running build
running build_ext
Installing 'UnmanagedExports 1.2.7'.
Successfully installed 'UnmanagedExports 1.2.7'.

Using mt.exe from Visual C++ for Python
Microsoft (R) Manifest Tool version 5.2.3790.2076

Copyright (c) Microsoft Corporation 2005.

Microsoft (R) Build engine version 14.0.25123.0

All rights reserved.

assemblymanager.cs(206,37): warning CS0168: The variable 'e' is declared but never used [H:\docs\python\pythonnet-master\src\runtime\Python.Runtime.csproj]
Python.Runtime -> H:\docs\python\pythonnet-master\src\runtime\bin\x86\ReleaseWin\Python.Runtime.dll
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file “MinimumRecommendedRules.ruleset”。 [H:\docs\python\pythonnet-master\src\testing\Python.Test.csproj]
eventtest.cs(18,48): warning CS0067: The event 'EventTest.InternalStaticEvent' is never used [H:\docs\python\pythonnet-master\src\testing\Python.Test.csproj]
eventtest.cs(28,40): warning CS0067: The event 'EventTest.PrivateEvent' is never used [H:\docs\python\pythonnet-master\src\testing\Python.Test.csproj]
eventtest.cs(20,47): warning CS0067: The event 'EventTest.PrivateStaticEvent' is never used [H:\docs\python\pythonnet-master\src\testing\Python.Test.csproj]
eventtest.cs(26,41): warning CS0067: The event 'EventTest.InternalEvent' is never used [H:\docs\python\pythonnet-master\src\testing\Python.Test.csproj]
Python.Test -> H:\docs\python\pythonnet-master\src\testing\bin\x86\ReleaseWin\Python.Test.dll
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: 无法找到规则集文件“MinimumRecommendedRules.ruleset”。 [H:\docs\python\pythonnet-master\src\embed_tests\Python.EmbeddingTest.csproj]
Python.EmbeddingTest -> H:\docs\python\pythonnet-master\src\embed_tests\bin\x86\ReleaseWin\Python.EmbeddingTest.dll
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file “MinimumRecommendedRules.ruleset”。 [H:\docs\python\pythonnet-master\src\console\Console.csproj]
assemblyinfo.cs(13,35): warning CS0618: 'SecurityAction.RequestMinimum' is obsolete: 'Assembly level declarative security is obsolete and is no longer enforced by the CLR by default. See http://go.microsoft.com/fwlink/?LinkID=155570 for more information.' [H:\docs\python\pythonnet-master\src\console\Console.csproj]
Console -> H:\docs\python\pythonnet-master\src\console\bin\x86\Release\nPython.exe
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.CSharp.CurrentVersion.targets(133,9): warning MSB3884: Could not find rule set file “MinimumRecommendedRules.ruleset”。 [H:\docs\python\pythonnet-master\src\clrmodule\clrmodule.csproj]
clrmodule -> H:\docs\python\pythonnet-master\src\clrmodule\bin\x86\ReleaseWin\clrmodule.dll
H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.targets(58,3): error : C:\Users\scy\AppData\Local\Temp\tmp9B4A\clrmodule.il(65) : error : syntax error at token '.field' in: .field static assembly initonly int64 'D43BE459642EEF2653B9DF1524152974360EA4C5' at I_00002DE0 [H:\docs\python\pythonnet-master\src\clrmodule\clrmodule.csproj]
H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.targets(58,3): error : [H:\docs\python\pythonnet-master\src\clrmodule\clrmodule.csproj]
Traceback (most recent call last):
File "setup.py", line 354, in
setup_requires=setup_requires
File "c:\python35\Lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python35\Lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\python35\Lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "G:\pythonEnv\carMgrPy351\lib\site-packages\wheel\bdist_wheel.py", line 179, in run
self.run_command('build')
File "c:\python35\Lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python35\Lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python35\Lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python35\Lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python35\Lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python35\Lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "c:\python35\Lib\distutils\command\build_ext.py", line 447, in build_extensions
self._build_extensions_serial()
File "c:\python35\Lib\distutils\command\build_ext.py", line 472, in _build_extensions_serial
self.build_extension(ext)
File "setup.py", line 187, in build_extension
check_call(" ".join(cmd + ["/t:Build"]), shell=use_shell)
File "c:\python35\Lib\subprocess.py", line 584, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '"C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe" pythonnet.sln /p:Configuration=ReleaseWin /p:Platform=x86 /p:DefineConstants="PYTHON35;UCS2" /p:PythonBuildDir="H:\docs\python\pythonnet-master\build\lib.win32-3.5" /p:PythonInteropFile="interop35.cs" /verbosity:minimal /p:PythonManifest="H:\docs\python\pythonnet-master\build\lib.win32-3.5\app.manifest" /t:Build' returned non-zero exit status 1

@chunyisong
Copy link
Author

@denfromufa My env is:
Microsoft Windows 10 pro X64
Microsoft Visual Studio Enterprise 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01038
Installed Version: Enterprise

Architecture and Modeling Tools 00322-90150-00888-AA858
Microsoft Architecture and Modeling Tools

UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

Visual Basic 2015 00322-90150-00888-AA858
Microsoft Visual Basic 2015

Visual C# 2015 00322-90150-00888-AA858
Microsoft Visual C# 2015

Visual C++ 2015 00322-90150-00888-AA858
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU 00322-90150-00888-AA858
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package 5.2.60328.3
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8) 14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.2.40314.0
For additional information, visit http://www.asp.net/

Common Azure Tools 1.7
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Project System 2.0
JavaScript Project System

Microsoft Azure Mobile Services Tools 1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager 3.4.3
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

Python Tools for Visual Studio 2.2.40315.00
Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration 2.2.40315.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support 2.2.40315.00
Profiling support for Python projects.

SQL Server Data Tools 14.0.60311.1
Microsoft SQL Server Data Tools

TypeScript 1.8.29.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps 14.0.25123.00
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

@chunyisong chunyisong changed the title window10 Visual Studio 2015 clrmodule build error [reopen] Win10 VS2015 syntax error at token '.field' in: .field static assembly initonly int64 [reopen] May 27, 2016
@chunyisong
Copy link
Author

in file clrmodul.il:
image

@den-run-ai
Copy link
Contributor

Ok, let me try with .net 4.6, did you actually change python project
settings from .NET 4.0 to 4.6?

Also I need to upgrade my VS 2015 to Update 2, not sure if enterprise
edition matters.

In the meantime, can you uninstall MSVC Compiler for Python 2.7 and try
again? Your VS 2015 already includes C compiler and mt.exe.

On Friday, May 27, 2016, chunyisong notifications@github.com wrote:

@denfromufa https://github.com/denfromufa My env is:

Microsoft Windows 10 pro X64
Microsoft Visual Studio Enterprise 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01038
Installed Version: Enterprise

Architecture and Modeling Tools 00322-90150-00888-AA858
Microsoft Architecture and Modeling Tools

UML® and Unified Modeling Language™ are trademarks or registered
trademarks of the Object Management Group, Inc. in the United States and
other countries.

Visual Basic 2015 00322-90150-00888-AA858
Microsoft Visual Basic 2015

Visual C# 2015 00322-90150-00888-AA858
Microsoft Visual C# 2015

Visual C++ 2015 00322-90150-00888-AA858
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU 00322-90150-00888-AA858
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package 5.2.60328.3
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8) 14.1.11106.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0
For additional information, visit
http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013 5.2.40314.0
For additional information, visit http://www.asp.net/

Common Azure Tools 1.7
Provides common services for use by Azure Mobile Services and Microsoft
Azure Tools.

JavaScript Project System 2.0
JavaScript Project System

Microsoft Azure Mobile Services Tools 1.4
Microsoft Azure Mobile Services Tools

NuGet Package Manager 3.4.3
NuGet Package Manager in Visual Studio. For more information about NuGet,
visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer 1.2
Microsoft Visual Studio extension to visualize aggregated summaries from
the PreEmptive Analytics product.

Python Tools for Visual Studio 2.2.40315.00
Python Tools for Visual Studio provides IntelliSense, projects, templates,
Interactive windows, and other support for Python developers.

Python Tools for Visual Studio - Django Integration 2.2.40315.00
Provides templates and integration for the Django web framework.

Python Tools for Visual Studio - Profiling Support 2.2.40315.00
Profiling support for Python projects.

SQL Server Data Tools 14.0.60311.1
Microsoft SQL Server Data Tools

TypeScript 1.8.29.0
TypeScript tools for Visual Studio

Visual Studio Tools for Universal Windows Apps 14.0.25123.00
The Visual Studio Tools for Universal Windows apps allow you to build a
single universal app experience that can reach every device running Windows
10: phone, tablet, PC, and more. It includes the Microsoft Windows 10
Software Development Kit.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#220 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AHgZ5b7U5w8OfEAmNaVaDoNKAAtydze4ks5qFo7_gaJpZM4IoHUD
.

@chunyisong
Copy link
Author

chunyisong commented May 27, 2016

@denfromufa Actually my python project target framework settings is .NET Framework 4.
I will not use higher .net version if it is possible.
image

@chunyisong
Copy link
Author

@denfromufa I uninstall MSVC Compiler for Python 2.7 using VCCompilerForPython27.msi ,and try rebuild again ,but the same error occur:
2> clrmodule -> H:\docs\python\pythonnet-master\src\clrmodule\bin\x86\ReleaseWin\clrmodule.dll
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.targets(58,3): error : C:\Users\scy\AppData\Local\Temp\tmp70B8\clrmodule.il(65) : error : syntax error at token '.field' in: .field static assembly initonly int64 'D43BE459642EEF2653B9DF1524152974360EA4C5' at I_00002DE0

@den-run-ai
Copy link
Contributor

clmodule.il should not be used anymore in the build process. This is stated in comments for clrmodule projecy. Now unmanaged exports is automagically generating clrmodule.il and compiling to clr.pyd, but this is failing on you badly.

@den-run-ai
Copy link
Contributor

I tried upgrading to VS 2015 Update 2 (not Enterprise, but Professional) on
Windows 10, and still do not see your error. Everything builds fine!

So do you mind installing git, add it to your %path% env. var. and try:

pip install git+https://github.com/pythonnet/pythonnet

I wonder if something is wrong with the source code that you downloaded.

On Fri, May 27, 2016 at 2:48 AM, chunyisong notifications@github.com
wrote:

@denfromufa https://github.com/denfromufa I uninstall MSVC Compiler for
Python 2.7 using VCCompilerForPython27.msi ,and try rebuild again ,but the
same error occur:
2> clrmodule ->
H:\docs\python\pythonnet-master\src\clrmodule\bin\x86\ReleaseWin\clrmodule.dll
2>H:\docs\python\pythonnet-master\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.targets(58,3):
error : C:\Users\scy\AppData\Local\Temp\tmp70B8\clrmodule.il(65) : error
: syntax error at token '.field' in: .field static assembly initonly int64
'D43BE459642EEF2653B9DF1524152974360EA4C5' at I_00002DE0


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#220 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AHgZ5ar2mWY4wCvI_r9amy0YMITzDMBIks5qFqHkgaJpZM4IoHUD
.

@chunyisong
Copy link
Author

chunyisong commented May 30, 2016

@denfromufa I'm sorry for late to response.I try two works this weekend as follows:

First, I install pythonnet using github,then rebuild and the same error occurs. 2>H:\docs\python\pythonnet\packages\UnmanagedExports.1.2.6\tools\RGiesecke.DllExport.targets(42,5): error : Microsoft.Build.Utilities.ToolLocationHelper could not find ildasm.exe.
2>H:\docs\python\pythonnet\packages\UnmanagedExports.1.2.6\tools\RGiesecke.DllExport.targets(42,5): error : C:\Users\scy\AppData\Local\Temp\tmpDBCF\clrmodule.il(62) : error : syntax error at token '.field' in: .field static assembly initonly int64 'D43BE459642EEF2653B9DF1524152974360EA4C5' at I_00002BE0
Addition,the same error occurs when using cmd: python setup.py bdist_wheel.

Second,I unistall VS2015 Enterprise completely,and install VS2015 Professional,the same error ( descriped at First ....field static assembly initonly int64 ...) occurs when rebuilding in VS.
But when trying in cmd " python setup.py bdist_wheel" Rais a Different Error (" .field static assembly initonly int64 ") as follows:

H:\docs\python\pythonnet>g:\pythonEnv\carMgrPy351\Scripts\activate
(carMgrPy351) H:\docs\python\pythonnet>python setup.py bdist_wheel
running bdist_wheel
running build
running build_ext
Traceback (most recent call last):
File "setup.py", line 357, in
setup_requires=setup_requires
File "c:\python35\Lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python35\Lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\python35\Lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "G:\pythonEnv\carMgrPy351\lib\site-packages\wheel\bdist_wheel.py", line 179, in run
self.run_command('build')
File "c:\python35\Lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python35\Lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python35\Lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python35\Lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python35\Lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python35\Lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "c:\python35\Lib\distutils\command\build_ext.py", line 447, in build_extensions
self._build_extensions_serial()
File "c:\python35\Lib\distutils\command\build_ext.py", line 472, in _build_extensions_serial
self.build_extension(ext)
File "c:\python35\Lib\contextlib.py", line 77, in exit
self.gen.throw(type, value, traceback)
File "c:\python35\Lib\distutils\command\build_ext.py", line 477, in _filter_build_errors
yield
File "c:\python35\Lib\distutils\command\build_ext.py", line 472, in _build_extensions_serial
self.build_extension(ext)
File "setup.py", line 181, in build_extension
manifest = self._get_manifest(dest_dir)
File "setup.py", line 195, in _get_manifest
mt = _find_msbuild_tool("mt.exe", use_windows_sdk=True)
File "setup.py", line 95, in _find_msbuild_tool
raise RuntimeError("%s could not be found" % tool)
RuntimeError: mt.exe could not be found

Updating "UnmanagedExports.1.2.6" to "UnmanagedExports.1.2.7" can not solve the error. I'm confused。May be My windows Lack of some dependency lib?!
Thanks for helping.

@den-run-ai
Copy link
Contributor

perhaps @RobertGiesecke can explain what is wrong?

@yajiedesign
Copy link

yajiedesign commented Sep 2, 2016

i have same problem

@yajiedesign
Copy link

yajiedesign commented Sep 2, 2016

ok,I found and fixed the problem.
RGiesecke.DllExport does not support non English ILdasm generated IL file.
You can patch RGiesecke.DllExport with ilspy to fix it.
Find and change "// Code" to you system language.
It is in RGiesecke.DllExport.Parsing.Actions.DeleteExportAttributeParserAction.Execute
@denfromufa
@chunyisong

@den-run-ai
Copy link
Contributor

@yajiedesign this is great finding, perhaps you can report this to @RobertGiesecke.

@chunyisong can you test this solution above?

@den-run-ai
Copy link
Contributor

@yajiedesign I updated the troubleshooting wiki with your solution:

https://github.com/denfromufa/pythonnet/wiki/Troubleshooting-FAQ

@chunyisong
Copy link
Author

chunyisong commented Sep 5, 2016

@yajiedesign @denfromufa I'm sorry,I can not find which code to change! I'm new to .net, Can you tell me which file and line the code is. My ststem is Chinese

@den-run-ai
Copy link
Contributor

@chunyisong you need to use ILSPY to open RGiesecke.DllExport.dll installed in pythonnet/packages/UnmanagedExports directory. Edit the code and recompile it with VS.

Alternatively here is a Visual Studio project/solution with Unmanaged Exports decompiled and maintained by @3F:

https://github.com/3F/DllExport

@den-run-ai
Copy link
Contributor

Alternatively you can change you system language like suggested here:

http://vb6-to-csharp.blogspot.com/2012/04/code-to-export-c-dll-to-metatrader.html?showComment=1398834618131#c6534378792185890995

@chunyisong
Copy link
Author

@denfromufa @yajiedesign I changed my win10 system language to english US,and all builds sucess,no error occurs!

In addition,I think there would be a better solution than change language!
Thanks !

@den-run-ai
Copy link
Contributor

@chunyisong this solution is due to a problem in third-party library (Unmanaged Exports) not in pythonnet, and opened an issue for this:

3F/DllExport#7

@AlexanderHuang
Copy link

AlexanderHuang commented Mar 26, 2018

Hi @denfromufa , the "UnmanagedExports" already has 1.6 version. Is there plan to update the "UnmanagedExports" part to the new version? I am hoping the new version can fix the Chinese Win 10 version problem.

@den-run-ai
Copy link
Contributor

@AlexanderHuang have you tested and confirmed that the latest dllexport fixes this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants