Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6c0081

Browse files
BadSingletonfilmorlostmsu
authored
Support changes to CLR code when domain reloads
* Adds test cases for member changes during a domain reload * Rework the serialization of reflected types Serialization of System.Type, MemberInfo and MethodBase is now string based. At deserialization, use reflection to attempt to recreate the object, which may fail safely instead of throwing a SerializaitonException during the deserialization of the whoie data stream. Appropriate Exceptions will now be raised when the Maybe*'s Value property. ClassBase objects are now de-initialized and re-initialized in Reload mode so that it's tp_dict picks up newly added members and removed members no longer linger. ModuleObject clears it's cache and remove cached members from it's tp_dict. Minor refactoring and modernization of MethodObject and MethodBinder * Call PyType_Modified after modifying the type Changing a type's attribute causes problem with it's cache. Force the type to refresh itself when modifying it. * Refactor the member binding logic of ClassManager So that we can use that same logic when deserializing Maybe* types * Include info about why deserialization failed in Maybe* * Remove TestClassReference The test case is covered in test_domain_relaod Co-authored-by: Benedikt Reinartz <[email protected]> Co-authored-by: Victor Milovanov <[email protected]>
1 parent 0c41273 commit d6c0081

29 files changed

+2033
-235
lines changed

pythonnet.sln

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Test", "src\testing\
1414
EndProject
1515
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.PerformanceTests", "src\perf_tests\Python.PerformanceTests.csproj", "{4F2EA4A1-7ECA-48B5-8077-7A3C366F9931}"
1616
EndProject
17+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.DomainReloadTests", "src\domain_tests\Python.DomainReloadTests.csproj", "{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}"
18+
EndProject
1719
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo", "Repo", "{441A0123-F4C6-4EE4-9AEE-315FD79BE2D5}"
1820
ProjectSection(SolutionItems) = preProject
1921
.editorconfig = .editorconfig
@@ -131,6 +133,18 @@ Global
131133
{4F2EA4A1-7ECA-48B5-8077-7A3C366F9931}.Release|x64.Build.0 = Release|x64
132134
{4F2EA4A1-7ECA-48B5-8077-7A3C366F9931}.Release|x86.ActiveCfg = Release|x86
133135
{4F2EA4A1-7ECA-48B5-8077-7A3C366F9931}.Release|x86.Build.0 = Release|x86
136+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
137+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
138+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Debug|x64.ActiveCfg = Debug|Any CPU
139+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Debug|x64.Build.0 = Debug|Any CPU
140+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Debug|x86.ActiveCfg = Debug|Any CPU
141+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Debug|x86.Build.0 = Debug|Any CPU
142+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
143+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Release|Any CPU.Build.0 = Release|Any CPU
144+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Release|x64.ActiveCfg = Release|Any CPU
145+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Release|x64.Build.0 = Release|Any CPU
146+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Release|x86.ActiveCfg = Release|Any CPU
147+
{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}.Release|x86.Build.0 = Release|Any CPU
134148
{6CF9EEA0-F865-4536-AABA-739AE3DA971E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
135149
{6CF9EEA0-F865-4536-AABA-739AE3DA971E}.Debug|Any CPU.Build.0 = Debug|Any CPU
136150
{6CF9EEA0-F865-4536-AABA-739AE3DA971E}.Debug|x64.ActiveCfg = Debug|Any CPU

src/domain_tests/App.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
5+
</startup>
6+
</configuration>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>net472</TargetFrameworks>
5+
<OutputPath>bin\</OutputPath>
6+
<OutputType>Exe</OutputType>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<Reference Include="System" />
11+
<Reference Include="System.Core" />
12+
<Reference Include="System.Xml.Linq" />
13+
<Reference Include="System.Data.DataSetExtensions" />
14+
<Reference Include="System.Data" />
15+
<Reference Include="System.Xml" />
16+
</ItemGroup>
17+
18+
<ItemGroup>
19+
<ProjectReference Include="..\runtime\Python.Runtime.csproj" />
20+
</ItemGroup>
21+
22+
<ItemGroup>
23+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" />
24+
</ItemGroup>
25+
26+
</Project>

0 commit comments

Comments
 (0)