diff --git a/pythonnet.sln b/pythonnet.sln index 64bf45fa2..54523d62e 100644 --- a/pythonnet.sln +++ b/pythonnet.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30110.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Runtime", "src\runtime\Python.Runtime.csproj", "{097B4AC0-74E9-4C58-BCF8-C69746EC8271}" EndProject @@ -13,90 +13,264 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "src\console\Cons EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "clrmodule", "src\clrmodule\clrmodule.csproj", "{86E834DE-1139-4511-96CC-69636A56E7AC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Config", "src\config\Python.Config.csproj", "{C4779672-F707-4778-B901-7C63548A3D6A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Python.Config.Test", "src\configtest\Python.Config.Test.csproj", "{D542CC7B-A5E3-475D-93EC-D0024ADE4328}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + DebugMono|Any CPU = DebugMono|Any CPU DebugMono|x64 = DebugMono|x64 DebugMono|x86 = DebugMono|x86 + DebugWin|Any CPU = DebugWin|Any CPU DebugWin|x64 = DebugWin|x64 DebugWin|x86 = DebugWin|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + ReleaseMono|Any CPU = ReleaseMono|Any CPU ReleaseMono|x64 = ReleaseMono|x64 ReleaseMono|x86 = ReleaseMono|x86 + ReleaseWin|Any CPU = ReleaseWin|Any CPU ReleaseWin|x64 = ReleaseWin|x64 ReleaseWin|x86 = ReleaseWin|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Any CPU.ActiveCfg = ReleaseWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|Any CPU.Build.0 = ReleaseWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|x64.ActiveCfg = DebugWin|x64 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|x64.Build.0 = DebugWin|x64 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|x86.ActiveCfg = DebugWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Debug|x86.Build.0 = DebugWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugMono|Any CPU.ActiveCfg = DebugMono|x86 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugMono|x64.ActiveCfg = DebugMono|x64 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugMono|x64.Build.0 = DebugMono|x64 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugMono|x86.ActiveCfg = DebugMono|x86 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugMono|x86.Build.0 = DebugMono|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugWin|Any CPU.ActiveCfg = DebugWin|x86 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugWin|x64.ActiveCfg = DebugWin|x64 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugWin|x64.Build.0 = DebugWin|x64 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugWin|x86.ActiveCfg = DebugWin|x86 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.DebugWin|x86.Build.0 = DebugWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|Any CPU.ActiveCfg = ReleaseWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|Any CPU.Build.0 = ReleaseWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|x64.ActiveCfg = ReleaseWin|x64 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|x64.Build.0 = ReleaseWin|x64 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|x86.ActiveCfg = ReleaseWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.Release|x86.Build.0 = ReleaseWin|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|x86 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseMono|x64.ActiveCfg = ReleaseMono|x64 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseMono|x64.Build.0 = ReleaseMono|x64 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseMono|x86.ActiveCfg = ReleaseMono|x86 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseMono|x86.Build.0 = ReleaseMono|x86 + {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|x86 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 {097B4AC0-74E9-4C58-BCF8-C69746EC8271}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Debug|Any CPU.ActiveCfg = ReleaseWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Debug|Any CPU.Build.0 = ReleaseWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Debug|x64.ActiveCfg = DebugWin|x64 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Debug|x64.Build.0 = DebugWin|x64 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Debug|x86.ActiveCfg = DebugWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Debug|x86.Build.0 = DebugWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugMono|Any CPU.ActiveCfg = DebugMono|x86 {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugMono|x64.ActiveCfg = DebugMono|x64 {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugMono|x64.Build.0 = DebugMono|x64 {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugMono|x86.ActiveCfg = DebugMono|x86 {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugMono|x86.Build.0 = DebugMono|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugWin|Any CPU.ActiveCfg = DebugWin|x86 {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugWin|x64.ActiveCfg = DebugWin|x64 {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugWin|x64.Build.0 = DebugWin|x64 {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugWin|x86.ActiveCfg = DebugWin|x86 {6F401A34-273B-450F-9A4C-13550BE0767B}.DebugWin|x86.Build.0 = DebugWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Release|Any CPU.ActiveCfg = ReleaseWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Release|Any CPU.Build.0 = ReleaseWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Release|x64.ActiveCfg = ReleaseWin|x64 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Release|x64.Build.0 = ReleaseWin|x64 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Release|x86.ActiveCfg = ReleaseWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.Release|x86.Build.0 = ReleaseWin|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|x86 {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseMono|x64.ActiveCfg = ReleaseMono|x64 {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseMono|x64.Build.0 = ReleaseMono|x64 {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseMono|x86.ActiveCfg = ReleaseMono|x86 {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseMono|x86.Build.0 = ReleaseMono|x86 + {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|x86 {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 {6F401A34-273B-450F-9A4C-13550BE0767B}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Debug|Any CPU.ActiveCfg = ReleaseWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Debug|Any CPU.Build.0 = ReleaseWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Debug|x64.ActiveCfg = DebugWin|x64 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Debug|x64.Build.0 = DebugWin|x64 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Debug|x86.ActiveCfg = DebugWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Debug|x86.Build.0 = DebugWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugMono|Any CPU.ActiveCfg = DebugMono|x86 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugMono|x64.ActiveCfg = DebugMono|x64 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugMono|x64.Build.0 = DebugMono|x64 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugMono|x86.ActiveCfg = DebugMono|x86 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugMono|x86.Build.0 = DebugMono|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugWin|Any CPU.ActiveCfg = DebugWin|x86 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugWin|x64.ActiveCfg = DebugWin|x64 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugWin|x64.Build.0 = DebugWin|x64 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugWin|x86.ActiveCfg = DebugWin|x86 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.DebugWin|x86.Build.0 = DebugWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Release|Any CPU.ActiveCfg = ReleaseWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Release|Any CPU.Build.0 = ReleaseWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Release|x64.ActiveCfg = ReleaseWin|x64 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Release|x64.Build.0 = ReleaseWin|x64 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Release|x86.ActiveCfg = ReleaseWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.Release|x86.Build.0 = ReleaseWin|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|x86 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseMono|x64.ActiveCfg = ReleaseMono|x64 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseMono|x64.Build.0 = ReleaseMono|x64 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseMono|x86.ActiveCfg = ReleaseMono|x86 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseMono|x86.Build.0 = ReleaseMono|x86 + {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|x86 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 {4165C59D-2822-499F-A6DB-EACA4C331EB5}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Debug|x64.ActiveCfg = Debug|x64 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Debug|x64.Build.0 = Debug|x64 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Debug|x86.ActiveCfg = Debug|x86 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Debug|x86.Build.0 = Debug|x86 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugMono|Any CPU.ActiveCfg = DebugMono_x86|Any CPU + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugMono|Any CPU.Build.0 = DebugMono_x86|Any CPU {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugMono|x64.ActiveCfg = DebugMono_x86|x64 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugMono|x64.Build.0 = DebugMono_x86|x64 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugMono|x86.ActiveCfg = DebugMono_x86|x86 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugMono|x86.Build.0 = DebugMono_x86|x86 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugWin|Any CPU.ActiveCfg = DebugMono_x86|Any CPU + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugWin|Any CPU.Build.0 = DebugMono_x86|Any CPU {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugWin|x64.ActiveCfg = DebugMono_x86|x64 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugWin|x64.Build.0 = DebugMono_x86|x64 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugWin|x86.ActiveCfg = DebugMono_x86|x86 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.DebugWin|x86.Build.0 = DebugMono_x86|x86 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Release|Any CPU.Build.0 = Release|Any CPU + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Release|x64.ActiveCfg = Release|x64 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Release|x64.Build.0 = Release|x64 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Release|x86.ActiveCfg = Release|x86 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.Release|x86.Build.0 = Release|x86 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseMono|Any CPU.ActiveCfg = Release|Any CPU + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseMono|Any CPU.Build.0 = Release|Any CPU {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseMono|x64.ActiveCfg = Release|x64 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseMono|x64.Build.0 = Release|x64 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseMono|x86.ActiveCfg = Release|x86 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseMono|x86.Build.0 = Release|x86 + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseWin|Any CPU.ActiveCfg = Release|Any CPU + {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseWin|Any CPU.Build.0 = Release|Any CPU {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseWin|x64.ActiveCfg = Release|x64 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseWin|x64.Build.0 = Release|x64 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseWin|x86.ActiveCfg = Release|x86 {E29DCF0A-5114-4A98-B1DD-71264B6EA349}.ReleaseWin|x86.Build.0 = Release|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Debug|Any CPU.ActiveCfg = ReleaseMono|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Debug|Any CPU.Build.0 = ReleaseMono|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Debug|x64.ActiveCfg = DebugMono|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Debug|x64.Build.0 = DebugMono|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Debug|x86.ActiveCfg = DebugMono|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Debug|x86.Build.0 = DebugMono|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.DebugMono|Any CPU.ActiveCfg = DebugMono|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.DebugMono|x64.ActiveCfg = DebugWin|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.DebugMono|x86.ActiveCfg = DebugWin|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.DebugWin|Any CPU.ActiveCfg = DebugWin|x86 {86E834DE-1139-4511-96CC-69636A56E7AC}.DebugWin|x64.ActiveCfg = DebugWin|x64 {86E834DE-1139-4511-96CC-69636A56E7AC}.DebugWin|x64.Build.0 = DebugWin|x64 {86E834DE-1139-4511-96CC-69636A56E7AC}.DebugWin|x86.ActiveCfg = DebugWin|x86 {86E834DE-1139-4511-96CC-69636A56E7AC}.DebugWin|x86.Build.0 = DebugWin|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Release|Any CPU.ActiveCfg = ReleaseMono|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Release|Any CPU.Build.0 = ReleaseMono|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Release|x64.ActiveCfg = ReleaseMono|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Release|x64.Build.0 = ReleaseMono|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Release|x86.ActiveCfg = ReleaseMono|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.Release|x86.Build.0 = ReleaseMono|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.ReleaseMono|Any CPU.ActiveCfg = ReleaseMono|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.ReleaseMono|x64.ActiveCfg = ReleaseWin|x64 + {86E834DE-1139-4511-96CC-69636A56E7AC}.ReleaseMono|x86.ActiveCfg = ReleaseWin|x86 + {86E834DE-1139-4511-96CC-69636A56E7AC}.ReleaseWin|Any CPU.ActiveCfg = ReleaseWin|x86 {86E834DE-1139-4511-96CC-69636A56E7AC}.ReleaseWin|x64.ActiveCfg = ReleaseWin|x64 {86E834DE-1139-4511-96CC-69636A56E7AC}.ReleaseWin|x64.Build.0 = ReleaseWin|x64 {86E834DE-1139-4511-96CC-69636A56E7AC}.ReleaseWin|x86.ActiveCfg = ReleaseWin|x86 {86E834DE-1139-4511-96CC-69636A56E7AC}.ReleaseWin|x86.Build.0 = ReleaseWin|x86 + {C4779672-F707-4778-B901-7C63548A3D6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Debug|x64.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Debug|x64.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Debug|x86.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Debug|x86.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugMono|Any CPU.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugMono|Any CPU.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugMono|x64.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugMono|x64.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugMono|x86.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugMono|x86.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugWin|Any CPU.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugWin|Any CPU.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugWin|x64.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugWin|x64.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugWin|x86.ActiveCfg = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.DebugWin|x86.Build.0 = Debug|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Release|Any CPU.Build.0 = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Release|x64.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Release|x64.Build.0 = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Release|x86.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.Release|x86.Build.0 = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseMono|Any CPU.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseMono|Any CPU.Build.0 = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseMono|x64.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseMono|x64.Build.0 = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseMono|x86.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseMono|x86.Build.0 = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseWin|Any CPU.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseWin|Any CPU.Build.0 = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseWin|x64.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseWin|x64.Build.0 = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseWin|x86.ActiveCfg = Release|Any CPU + {C4779672-F707-4778-B901-7C63548A3D6A}.ReleaseWin|x86.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Debug|x64.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Debug|x64.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Debug|x86.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Debug|x86.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugMono|Any CPU.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugMono|Any CPU.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugMono|x64.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugMono|x64.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugMono|x86.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugMono|x86.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugWin|Any CPU.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugWin|Any CPU.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugWin|x64.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugWin|x64.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugWin|x86.ActiveCfg = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.DebugWin|x86.Build.0 = Debug|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Release|Any CPU.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Release|x64.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Release|x64.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Release|x86.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.Release|x86.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseMono|Any CPU.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseMono|Any CPU.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseMono|x64.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseMono|x64.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseMono|x86.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseMono|x86.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseWin|Any CPU.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseWin|Any CPU.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseWin|x64.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseWin|x64.Build.0 = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseWin|x86.ActiveCfg = Release|Any CPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328}.ReleaseWin|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/config/FodyWeavers.xml b/src/config/FodyWeavers.xml new file mode 100644 index 000000000..fe39ff17e --- /dev/null +++ b/src/config/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/config/ModuleInitializer.cs b/src/config/ModuleInitializer.cs new file mode 100644 index 000000000..caf0d9012 --- /dev/null +++ b/src/config/ModuleInitializer.cs @@ -0,0 +1,17 @@ +using System; + +using Python.Config; + +/// +/// Used by the ModuleInit. All code inside the Initialize method is ran as soon as the assembly is loaded. +/// +public static class ModuleInitializer +{ + /// + /// Initializes the module. + /// + public static void Initialize() + { + PythonConfig.EnsureInitialized(); + } +} \ No newline at end of file diff --git a/src/config/Properties/AssemblyInfo.cs b/src/config/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..1eb3b0f3d --- /dev/null +++ b/src/config/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("config")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("config")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c4779672-f707-4778-b901-7c63548a3d6a")] + +// PythonVersion information for an assembly consists of the following four values: +// +// Major PythonVersion +// Minor PythonVersion +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/config/Python.Config.csproj b/src/config/Python.Config.csproj new file mode 100644 index 000000000..799e2e7a4 --- /dev/null +++ b/src/config/Python.Config.csproj @@ -0,0 +1,77 @@ + + + + + Debug + AnyCPU + {C4779672-F707-4778-B901-7C63548A3D6A} + Library + Properties + Python.Config + Python.Config + v4.0 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + Python.Runtime-Py27-Win64.dll + + + Python.Runtime-Py35-Win64.dll + + + Python.Runtime-Py27-Linux64.dll + + + Python.Runtime-Py35-Linux64.dll + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + \ No newline at end of file diff --git a/src/config/Python.Runtime-Py27-Linux64.dll b/src/config/Python.Runtime-Py27-Linux64.dll new file mode 100644 index 000000000..7797457a0 Binary files /dev/null and b/src/config/Python.Runtime-Py27-Linux64.dll differ diff --git a/src/config/Python.Runtime-Py27-Win64.dll b/src/config/Python.Runtime-Py27-Win64.dll new file mode 100644 index 000000000..a0fe570a4 Binary files /dev/null and b/src/config/Python.Runtime-Py27-Win64.dll differ diff --git a/src/config/Python.Runtime-Py35-Linux64.dll b/src/config/Python.Runtime-Py35-Linux64.dll new file mode 100644 index 000000000..cf0f063a2 Binary files /dev/null and b/src/config/Python.Runtime-Py35-Linux64.dll differ diff --git a/src/config/Python.Runtime-Py35-Win64.dll b/src/config/Python.Runtime-Py35-Win64.dll new file mode 100644 index 000000000..addbef40f Binary files /dev/null and b/src/config/Python.Runtime-Py35-Win64.dll differ diff --git a/src/config/PythonConfig.cs b/src/config/PythonConfig.cs new file mode 100644 index 000000000..a2d306367 --- /dev/null +++ b/src/config/PythonConfig.cs @@ -0,0 +1,149 @@ +namespace Python.Config +{ + using System; + using System.Configuration; + using System.IO; + using System.Reflection; + using System.Text.RegularExpressions; + + /// + /// Python.Net runtime configuration. + /// + public static class PythonConfig + { + private static object _assemblyLoadLock = new object(); + + private static Exception _configException; + + private static Assembly _pythonRuntimeAssembly; + + private static string _pythonVersion; + + private static Regex _versionNumberRegex = new Regex("^(?\\d)\\.(?\\d)$"); + + /// + /// Initializes static members of the class. + /// + static PythonConfig() + { + if (IntPtr.Size == 4) + { + throw new NotSupportedException("32 bit platform not supported by Python.Config library."); + } + AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolveHandler; + } + + /// + /// Loaded assembly name. + /// + public static string LoadedRuntimeAssembly { get; private set; } + + /// + /// Pyhon runtime version. Can be changed only + /// + public static string PythonVersion + { + get + { + if (_pythonVersion == null) + { + try + { + var pythonConfigSection = (PythonConfigSection)ConfigurationManager.GetSection("pythonConfig"); + _pythonVersion = pythonConfigSection.PythonVersion; + + ValidatePythonVersion(_pythonVersion); + } + catch (Exception ex) + { + _pythonVersion = "2.7"; + _configException = ex; + AppDomain.CurrentDomain.SetData("PythonConfigException", _configException); + } + } + + return _pythonVersion; + } + + private set + { + // Disabling this feature. Dynamic version select should be implemented through callback in configuration file. + if (IsRuntimeAssemblyLoaded) + { + throw new InvalidOperationException( + "Python version can be changed only before Python.Runtime assembly loaded by CLR."); + } + + ValidatePythonVersion(value); + _pythonVersion = value; + } + } + + /// + /// Used internally to determine that Python.Runtime assembly already loaded. + /// + internal static bool IsRuntimeAssemblyLoaded { get; set; } + + /// + /// Forces Python Config library to be initialized. + /// + public static void EnsureInitialized() + { + // Do nothing, but forces CLR to load PythonConfig type. + } + + private static Assembly AssemblyResolveHandler(object sender, ResolveEventArgs args) + { + if (args.Name.StartsWith("Python.Runtime")) + { + lock (_assemblyLoadLock) + { + if (_pythonRuntimeAssembly != null) + { + return _pythonRuntimeAssembly; + } + + string platform = Path.DirectorySeparatorChar == '\\' ? "Win64" : "Linux64"; + + // We will load assembly here. + string resourceName = $"Python.Runtime-Py{PythonVersion.Replace(".", string.Empty)}-{platform}.dll"; + + // looks for the assembly from the resources and load it + using (var stream = typeof(PythonConfig).Assembly.GetManifestResourceStream(resourceName)) + { + if (stream != null) + { + byte[] assemblyData = new byte[stream.Length]; + stream.Read(assemblyData, 0, assemblyData.Length); + try + { + _pythonRuntimeAssembly = Assembly.Load(assemblyData); + LoadedRuntimeAssembly = resourceName; + return _pythonRuntimeAssembly; + } + catch (Exception ex) + { + AppDomain.CurrentDomain.SetData("PythonConfigException", ex); + } + } + } + } + } + + return null; + } + + private static void ValidatePythonVersion(string version) + { + if (!_versionNumberRegex.Match(version).Success) + { + throw new ArgumentException("Python version should be specified in x.y, for example \"2.7\"."); + } + + if (version != "2.7" && version != "3.5") + { + throw new ArgumentException("Unsupported python version. Only 2.7 and 3.5 are supported."); + } + } + } +} \ No newline at end of file diff --git a/src/config/PythonConfigSection.cs b/src/config/PythonConfigSection.cs new file mode 100644 index 000000000..ba6af2726 --- /dev/null +++ b/src/config/PythonConfigSection.cs @@ -0,0 +1,22 @@ +namespace Python.Config +{ + using System; + using System.Configuration; + + public class PythonConfigSection : ConfigurationSection + { + [ConfigurationProperty("pythonVersion", DefaultValue = "2.7", IsRequired = true)] + public string PythonVersion + { + get + { + return (string)this["pythonVersion"]; + } + + set + { + this["pythonVersion"] = value; + } + } + } +} \ No newline at end of file diff --git a/src/config/packages.config b/src/config/packages.config new file mode 100644 index 000000000..e9896e12a --- /dev/null +++ b/src/config/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/configtest/App.config b/src/configtest/App.config new file mode 100644 index 000000000..b82e26cda --- /dev/null +++ b/src/configtest/App.config @@ -0,0 +1,7 @@ + + + +
+ + + \ No newline at end of file diff --git a/src/configtest/Program.cs b/src/configtest/Program.cs new file mode 100644 index 000000000..4173e2118 --- /dev/null +++ b/src/configtest/Program.cs @@ -0,0 +1,65 @@ +namespace Python.Config.Test +{ + using System; + + using Python.Runtime; + + internal class Program + { + static Program() + { + Console.WriteLine("Starting application..."); + // Required to be placed in the static constructor for Mono. + PythonConfig.EnsureInitialized(); + } + + [STAThread] + private static int Main(string[] args) + { + // Mono workaround required to fix AssemblyResolve + EntryPoint class bug. + // Classes that was referenced from EntryPoint class cannot use assemblies resolved through "AssemblyResolve" + Action monoWorkaround = () => + { + try + { + if (PythonConfig.LoadedRuntimeAssembly != null) + { + Console.WriteLine( + $"Python.runtime.dll substituted by {PythonConfig.LoadedRuntimeAssembly}."); + } + else + { + Console.WriteLine( + $"Python.runtime.dll was loaded from application directory."); + } + + // You should put this initialized only if some component starting to use it before first application configuration file read attempt. + // So in rare cases. + PythonEngine.Initialize(); + + // Like that. + try + { + using (Py.GIL()) + { + dynamic sysModule = Py.Import("sys"); + Console.WriteLine("Python engine version:"); + Console.WriteLine(sysModule.version); + } + } + finally + { + PythonEngine.Shutdown(); + } + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + }; + monoWorkaround(); + + return 0; + } + } +} \ No newline at end of file diff --git a/src/configtest/Properties/AssemblyInfo.cs b/src/configtest/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..aad07c168 --- /dev/null +++ b/src/configtest/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("configtest")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("configtest")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d542cc7b-a5e3-475d-93ec-d0024ade4328")] + +// PythonVersion information for an assembly consists of the following four values: +// +// Major PythonVersion +// Minor PythonVersion +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/configtest/Python.Config.Test.csproj b/src/configtest/Python.Config.Test.csproj new file mode 100644 index 000000000..7395d5419 --- /dev/null +++ b/src/configtest/Python.Config.Test.csproj @@ -0,0 +1,74 @@ + + + + + Debug + AnyCPU + {D542CC7B-A5E3-475D-93EC-D0024ADE4328} + Exe + Properties + Python.Config.Test + pcfgtest + v4.0 + 512 + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x64 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + Designer + + + + + {c4779672-f707-4778-b901-7c63548a3d6a} + Python.Config + + + {097b4ac0-74e9-4c58-bcf8-c69746ec8271} + Python.Runtime + False + + + + + \ No newline at end of file diff --git a/src/runtime/packages.config b/src/runtime/packages.config new file mode 100644 index 000000000..f980405a2 --- /dev/null +++ b/src/runtime/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/runtime/pythonengine.cs b/src/runtime/pythonengine.cs index 7e37d6211..c5dbaea5d 100644 --- a/src/runtime/pythonengine.cs +++ b/src/runtime/pythonengine.cs @@ -116,6 +116,12 @@ public static void Initialize() { if (!initialized) { + var configException = AppDomain.CurrentDomain.GetData("PythonConfigException") as Exception; + if (configException != null) + { + throw configException; + } + // Creating the delegateManager MUST happen before Runtime.Initialize // is called. If it happens afterwards, DelegateManager's CodeGenerator // throws an exception in its ctor. This exception is eaten somehow