X Tutup
Skip to content

Commit 2ed8bcb

Browse files
committed
Use net45 framework target.
1 parent 93968d2 commit 2ed8bcb

File tree

1 file changed

+9
-21
lines changed

1 file changed

+9
-21
lines changed

src/runtime/Python.Runtime.15.csproj

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<Project>
22
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
33
<PropertyGroup>
4-
<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>
5-
<Platforms>AnyCPU</Platforms>
4+
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
5+
<Platforms>AnyCPU;x64</Platforms>
66
<Configurations>DebugMono;DebugMonoPY3;ReleaseMono;ReleaseMonoPY3;DebugWin;DebugWinPY3;ReleaseWin;ReleaseWinPY3</Configurations>
7-
<AssetTargetFallback Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">net45</AssetTargetFallback>
87
<RootNamespace>Python.Runtime</RootNamespace>
98
<AssemblyName>Python.Runtime</AssemblyName>
109
<PackageId>pythonnet</PackageId>
@@ -23,22 +22,19 @@
2322
<PackageIconUrl>https://raw.githubusercontent.com/pythonnet/pythonnet/master/src/console/python-clear.ico</PackageIconUrl>
2423
<PackageProjectUrl>https://pythonnet.github.io/</PackageProjectUrl>
2524
<OutputPath>bin\</OutputPath>
26-
<AppendTargetFrameworkToOutputPath Condition="'$(TargetFramework)'=='net40'">false</AppendTargetFrameworkToOutputPath>
27-
<DocumentationFile Condition="'$(TargetFramework)'=='net40'">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
28-
<DocumentationFile Condition="'$(TargetFramework)'!='net40'">$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
25+
<DocumentationFile Condition="'$(TargetFramework)'=='net45'">$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
26+
<DocumentationFile Condition="'$(TargetFramework)'!='net45'">$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
2927
<NoWarn>1591;NU1701</NoWarn>
3028
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
3129
<PythonBuildDir Condition="'$(PythonBuildDir)' == ''">$(SolutionDir)\bin\</PythonBuildDir>
32-
<PublishDir Condition="'$(TargetFramework)'!='net40'">$(PythonBuildDir)\$(TargetFramework)\</PublishDir>
30+
<PublishDir Condition="'$(TargetFramework)'!='net45'">$(PythonBuildDir)\$(TargetFramework)\</PublishDir>
3331
<LangVersion>7.3</LangVersion>
3432
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
35-
<AssemblyOriginatorKeyFile>..\pythonnet.snk</AssemblyOriginatorKeyFile>
3633
<CustomDefineConstants Condition="'$(CustomDefineConstants)' == ''">$(PYTHONNET_DEFINE_CONSTANTS)</CustomDefineConstants>
3734
<BaseDefineConstants>XPLAT</BaseDefineConstants>
3835
<DefineConstants>$(DefineConstants);$(CustomDefineConstants);$(BaseDefineConstants);</DefineConstants>
3936
<DefineConstants Condition="'$(TargetFramework)'=='netstandard2.0'">$(DefineConstants);NETSTANDARD</DefineConstants>
4037
<DefineConstants Condition="'$(BuildingInsideVisualStudio)' == 'true' AND '$(CustomDefineConstants)' != '' AND $(Configuration.Contains('Debug'))">$(DefineConstants);TRACE;DEBUG</DefineConstants>
41-
<FrameworkPathOverride Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono'))">$(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.5\1.0.1\lib\net45\</FrameworkPathOverride>
4238
<Python2Version>$(PYTHONNET_PY2_VERSION)</Python2Version>
4339
<Python2Version Condition="'$(Python2Version)'==''">PYTHON27</Python2Version>
4440
<Python3Version>$(PYTHONNET_PY3_VERSION)</Python3Version>
@@ -49,11 +45,11 @@
4945
<PythonMonoDefineConstants Condition="'$(PythonMonoDefineConstants)'==''">UCS4;MONO_LINUX;PYTHON_WITH_PYMALLOC</PythonMonoDefineConstants>
5046
<PythonInteropFile Condition="'$(PythonInteropFile)'==''">$(PYTHONNET_INTEROP_FILE)</PythonInteropFile>
5147
</PropertyGroup>
52-
<PropertyGroup Condition="$(Configuration.Contains('Debug')) AND '$(TargetFramework)'=='net40'">
48+
<PropertyGroup Condition="$(Configuration.Contains('Debug')) AND '$(TargetFramework)'=='net45'">
5349
<Optimize>false</Optimize>
5450
<DebugType>full</DebugType>
5551
</PropertyGroup>
56-
<PropertyGroup Condition="$(Configuration.Contains('Release')) AND '$(TargetFramework)'=='net40'">
52+
<PropertyGroup Condition="$(Configuration.Contains('Release')) AND '$(TargetFramework)'=='net45'">
5753
<Optimize>true</Optimize>
5854
<DebugType>pdbonly</DebugType>
5955
</PropertyGroup>
@@ -121,27 +117,19 @@
121117
<PackageReference Include="System.Reflection.Emit" Version="4.3.0" />
122118
</ItemGroup>
123119

124-
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
120+
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
125121
<Reference Include="Microsoft.CSharp" />
126122
</ItemGroup>
127123

128-
<ItemGroup Condition="'$(TargetFramework)'=='net40'">
129-
<PackageReference Include="Microsoft.TargetingPack.NETFramework.v4.5" Version="1.0.1" ExcludeAssets="All" PrivateAssets="All" />
130-
</ItemGroup>
131-
132124
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
133125

134126
<PropertyGroup>
135127
<TargetAssembly>$(TargetPath)</TargetAssembly>
136128
<TargetAssemblyPdb>$(TargetDir)$(TargetName).pdb</TargetAssemblyPdb>
137129
</PropertyGroup>
138130

139-
<Target Name="BeforeBuild" Condition="'$(TargetFramework)'=='net40' AND $(Configuration.Contains('Mono')) AND '$(OS)' != 'Windows_NT'">
140-
<!--Endless war!-->
141-
<Exec Command="[[ -e $(NuGetPackageRoot)/microsoft.targetingpack.netframework.v4.5/1.0.1/lib/net45/System.Xml.dll ]] || cp $(NuGetPackageRoot)/microsoft.targetingpack.netframework.v4.5/1.0.1/lib/net45/System.XML.dll $(NuGetPackageRoot)/microsoft.targetingpack.netframework.v4.5/1.0.1/lib/net45/System.Xml.dll" />
142-
</Target>
143131
<Target Name="AfterBuild">
144-
<Copy Condition="'$(TargetFramework)'=='net40'" SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
132+
<Copy Condition="'$(TargetFramework)'=='net45'" SourceFiles="$(TargetAssembly)" DestinationFolder="$(PythonBuildDir)" />
145133
<!--Copy SourceFiles="$(TargetAssemblyPdb)" Condition="Exists('$(TargetAssemblyPdb)')" DestinationFolder="$(PythonBuildDir)" /-->
146134
</Target>
147135
</Project>

0 commit comments

Comments
 (0)
X Tutup