| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 39c575e commit cf0ce2e
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,3 +89,4 @@ | |||
| 89 | 89 | - Ehsan Iran-Nejad ([@eirannejad](https://github.com/eirannejad)) | |
| 90 | 90 | - ([@legomanww](https://github.com/legomanww)) | |
| 91 | 91 | - ([@gertdreyer](https://github.com/gertdreyer)) | |
| 92 | + - Kerbiter ([@Metadorius](https://github.com/Metadorius)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,12 +10,13 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. | |||
| 10 | 10 | ### Added | |
| 11 | 11 | ||
| 12 | 12 | - Support `del obj[...]` for types derived from `IList<T>` and `IDictionary<K, V>` | |
| 13 | + - Support for .NET Framework 4.6.1 (#2701) | ||
| 13 | 14 | ||
| 14 | 15 | ### Changed | |
| 15 | 16 | ### Fixed | |
| 16 | 17 | ||
| 17 | 18 | - Fixed crash when trying to `del clrObj[...]` for non-arrays | |
| 18 | - - ci: properly exclude job (#2542) | ||
| 19 | + - ci: properly exclude job (#2542) | ||
| 19 | 20 | ||
| 20 | 21 | ## [3.0.5](https://github.com/pythonnet/pythonnet/releases/tag/v3.0.5) - 2024-12-13 | |
| 21 | 22 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -45,7 +45,7 @@ Mono (``mono``) | |||
| 45 | 45 | ||
| 46 | 46 | .NET Framework (``netfx``) | |
| 47 | 47 | Default on Windows and also only supported there. Must be at least version | |
| 48 | - 4.7.2. | ||
| 48 | + 4.6.1, with 4.7.2 or later recommended. | ||
| 49 | 49 | ||
| 50 | 50 | .NET Core (``coreclr``) | |
| 51 | 51 | Self-contained is not supported, must be at least version 3.1. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -127,7 +127,7 @@ def finalize_options(self): | |||
| 127 | 127 | dotnet_libs = [ | |
| 128 | 128 | DotnetLib( | |
| 129 | 129 | "python-runtime", | |
| 130 | - "src/runtime/Python.Runtime.csproj", | ||
| 130 | + "src/compat/Python.Runtime.Compat.csproj", | ||
| 131 | 131 | output="pythonnet/runtime", | |
| 132 | 132 | ) | |
| 133 | 133 | ] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,13 @@ | |||
| 1 | + <!-- A dummy project to force MSBuild to package .NET 4.6.1 requirements --> | ||
| 2 | + <Project Sdk="Microsoft.NET.Sdk"> | ||
| 3 | + <PropertyGroup> | ||
| 4 | + <TargetFramework>net461</TargetFramework> | ||
| 5 | + <OutputType>Library</OutputType> | ||
| 6 | + <!-- Don't copy the dummy assembly/pdb to output; we only need the resolved references --> | ||
| 7 | + <CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory> | ||
| 8 | + <CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory> | ||
| 9 | + </PropertyGroup> | ||
| 10 | + <ItemGroup> | ||
| 11 | + <ProjectReference Include="..\runtime\Python.Runtime.csproj" /> | ||
| 12 | + </ItemGroup> | ||
| 13 | + </Project> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,5 @@ | |||
| 1 | 1 | using System; | |
| 2 | + using System.IO; | ||
| 2 | 3 | using System.Text; | |
| 3 | 4 | ||
| 4 | 5 | namespace Python.Runtime | |
@@ -12,6 +13,28 @@ public unsafe static int Initialize(IntPtr data, int size) | |||
| 12 | 13 | { | |
| 13 | 14 | try | |
| 14 | 15 | { | |
| 16 | + // On .NET Framework, the host is python.exe which has no binding | ||
| 17 | + // redirects for netstandard2.0 shims (e.g. RuntimeInformation | ||
| 18 | + // Version=0.0.0.0 vs the 4.0.2.0 shim on disk). Binding redirects | ||
| 19 | + // via config files can't be injected after AppDomain creation, so | ||
| 20 | + // resolve assemblies from our runtime directory directly. | ||
| 21 | + // Only needed on .NET Framework; on .NET (Core) this causes | ||
| 22 | + // duplicate assembly loads, as .deps.json is respected and | ||
| 23 | + // the correct assembly is already found. | ||
| 24 | + if (typeof(object).Assembly.GetName().Name == "mscorlib") | ||
| 25 | + { | ||
| 26 | + AppDomain.CurrentDomain.AssemblyResolve += (_, args) => | ||
| 27 | + { | ||
| 28 | + var name = new System.Reflection.AssemblyName(args.Name); | ||
| 29 | + var dir = Path.GetDirectoryName(typeof(Loader).Assembly.Location); | ||
| 30 | + var path = Path.Combine(dir, name.Name + ".dll"); | ||
| 31 | + | ||
| 32 | + return File.Exists(path) | ||
| 33 | + ? System.Reflection.Assembly.LoadFrom(path) | ||
| 34 | + : null; | ||
| 35 | + }; | ||
| 36 | + } | ||
| 37 | + | ||
| 15 | 38 | var dllPath = Encodings.UTF8.GetString((byte*)data.ToPointer(), size); | |
| 16 | 39 | ||
| 17 | 40 | if (!string.IsNullOrEmpty(dllPath)) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments