-
Notifications
You must be signed in to change notification settings - Fork 749
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
Comments
I find the same issue #216 ,so close this . |
@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:
Next is did you add |
@denfromufa I add "PYTHON35, UCS2" compilation symbols to both Python.Runtime and clrmodule projects ,but same errors occur! |
@chunyisong can you try to update unmanaged exports to 1.2.7? see here: also can you try to build pythonnet from python side (not in Visual Studio), see instructions here:
https://github.com/denfromufa/pythonnet/wiki/Troubleshooting-FAQ |
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. |
@denfromufa if I run command " python.exe setup.py bdist_wheel ",the Error is much the same: Using mt.exe from Visual C++ for Python 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] |
@denfromufa My env is: Architecture and Modeling Tools 00322-90150-00888-AA858 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 Visual C# 2015 00322-90150-00888-AA858 Visual C++ 2015 00322-90150-00888-AA858 Windows Phone SDK 8.0 - ENU 00322-90150-00888-AA858 Application Insights Tools for Visual Studio Package 5.2.60328.3 ASP.NET and Web Tools 2015.1 (Beta8) 14.1.11106.0 ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0 ASP.NET Web Frameworks and Tools 2013 5.2.40314.0 Common Azure Tools 1.7 JavaScript Project System 2.0 Microsoft Azure Mobile Services Tools 1.4 NuGet Package Manager 3.4.3 PreEmptive Analytics Visualizer 1.2 Python Tools for Visual Studio 2.2.40315.00 Python Tools for Visual Studio - Django Integration 2.2.40315.00 Python Tools for Visual Studio - Profiling Support 2.2.40315.00 SQL Server Data Tools 14.0.60311.1 TypeScript 1.8.29.0 Visual Studio Tools for Universal Windows Apps 14.0.25123.00 |
Ok, let me try with .net 4.6, did you actually change python project Also I need to upgrade my VS 2015 to Update 2, not sure if enterprise In the meantime, can you uninstall MSVC Compiler for Python 2.7 and try On Friday, May 27, 2016, chunyisong notifications@github.com wrote:
|
@denfromufa I uninstall MSVC Compiler for Python 2.7 using VCCompilerForPython27.msi ,and try rebuild again ,but the same error occur: |
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. |
I tried upgrading to VS 2015 Update 2 (not Enterprise, but Professional) on 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
|
@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. 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. 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?! |
perhaps @RobertGiesecke can explain what is wrong? |
i have same problem |
ok,I found and fixed the problem. |
@yajiedesign this is great finding, perhaps you can report this to @RobertGiesecke. @chunyisong can you test this solution above? |
@yajiedesign I updated the troubleshooting wiki with your solution: https://github.com/denfromufa/pythonnet/wiki/Troubleshooting-FAQ |
@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 |
@chunyisong you need to use ILSPY to open RGiesecke.DllExport.dll installed in Alternatively here is a Visual Studio project/solution with Unmanaged Exports decompiled and maintained by @3F: |
Alternatively you can change you system language like suggested here: |
@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! |
@chunyisong this solution is due to a problem in third-party library (Unmanaged Exports) not in pythonnet, and opened an issue for this: |
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. |
@AlexanderHuang have you tested and confirmed that the latest dllexport fixes this issue? |
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 ==========
I don't know much about C# and visual studio.Thank you very much for helping solving this problem.
The text was updated successfully, but these errors were encountered: