|
1 | 1 | <?xml version="1.0" encoding="utf-8"?>
|
2 | 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="CefSharpTransformXmlDllPath">
|
3 | 3 | <!--
|
4 |
| - MSBuild is finding CefSharp.Core.Runtime.dll from the x86 folder and copying it to the bin folder which is a problem for AnyCPU |
5 |
| - and when CefSharpTargetDir is used to move the files into a sub folder. |
| 4 | + MSBuild is finding CefSharp.Core.Runtime.dll from the x86/x64 folders and copying it to the bin folder which is a problem |
| 5 | + for targeting AnyCPU and when CefSharpTargetDir is used to move the files into a sub folder. |
| 6 | + AnyCPU/x86: |
| 7 | + - CefSharp.Core.Runtime.dll is copied from the x86 folder into the bin folder |
| 8 | + x64: |
| 9 | + - CefSharp.Core.Runtime.dll is copied from the x64 folder into the bin folder |
6 | 10 | We manually remove CefSharp.Core.Runtime.dll from ReferenceCopyLocalPaths
|
7 | 11 | https://thomasfreudenberg.com/archive/2012/11/21/dont-copy-my-referenced-assemblies/
|
8 | 12 | -->
|
9 | 13 | <Target Name="CefSharpExcludeCoreRuntimeAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="('$(CefSharpPlatformTarget)' == 'AnyCPU' OR '$(CefSharpTargetDir)' != '') AND $(TargetFrameworkVersion.StartsWith('v4.'))">
|
| 14 | + <PropertyGroup> |
| 15 | + <_CefSharpCoreRuntimeExclude>$(CefSharpPlatformTarget)</_CefSharpCoreRuntimeExclude> |
| 16 | + <_CefSharpCoreRuntimeExclude Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU'">x86</_CefSharpCoreRuntimeExclude> |
| 17 | + </PropertyGroup> |
10 | 18 | <ItemGroup>
|
11 |
| - <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.dll" /> |
12 |
| - <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.pdb" /> |
13 |
| - <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.xml" /> |
| 19 | + <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(_CefSharpCoreRuntimeExclude)\CefSharp.Core.Runtime.dll" /> |
| 20 | + <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(_CefSharpCoreRuntimeExclude)\CefSharp.Core.Runtime.pdb" /> |
| 21 | + <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(_CefSharpCoreRuntimeExclude)\CefSharp.Core.Runtime.xml" /> |
14 | 22 | </ItemGroup>
|
15 | 23 | </Target>
|
16 | 24 |
|
|
29 | 37 | <!--
|
30 | 38 | For AnyCPU ClickOnce Publish Remove CefSharp.Core.Runtime.dll for being included in the bin folder
|
31 | 39 | TODO: Publish AnyCPU still not working, requires some tweaking as CefSharp.dll file isn't being copied to the x64 folder.
|
| 40 | + TODO: Combine CefSharpAnyCPUExcludeCoreRuntimeBeforeGenerateApplicationManifest and CefSharpExcludeCoreRuntimeBeforeGenerateApplicationManifest |
| 41 | + use a property instead of two different targets |
32 | 42 | -->
|
33 | 43 | <Target Name="CefSharpAnyCPUExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND $(TargetFrameworkVersion.StartsWith('v4.'))">
|
34 | 44 | <ItemGroup>
|
|
104 | 114 | <!--
|
105 | 115 | For Sdk Projects the PlatformTarget is unreliable (https://github.com/dotnet/sdk/issues/1560)
|
106 | 116 | When our targets file is imported $(PlatformTarget) will be x86 when the Platform is infact AnyCPU.
|
107 |
| - By time the AfterBuilds target runs it's correctly set to AnyCPU as the GetDefaultPlatformTargetForNetFramework |
108 |
| - Task correctly sets the build to AnyCPU, unfortunately it's too late. Previous attempt to hack around this failed, |
109 |
| - relying on user to manually specify $(PlatformTarget) until the SDK issue is fixed. |
| 117 | + By time the AfterBuilds target runs it's correctly set to AnyCPU as the GetDefaultPlatformTargetForNetFramework |
| 118 | + Task correctly sets the build to AnyCPU, unfortunately it's too late. Previous attempt to hack around this failed, |
| 119 | + relying on user to manually specify $(PlatformTarget) until the SDK issue is fixed. |
110 | 120 | When AnyCPU and Prefer32Bit we just set the PlatformTarget to x86 (only when CefSharpAnyCpuSupport is empty)
|
111 | 121 | -->
|
112 | 122 | <CefSharpPlatformTarget>$(PlatformTarget)</CefSharpPlatformTarget>
|
113 | 123 | <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == ''">$(Platform)</CefSharpPlatformTarget>
|
114 |
| - <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == 'Win32'">x86</CefSharpPlatformTarget> |
115 |
| - <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(Prefer32Bit)' == 'true' AND '$(CefSharpAnyCpuSupport)' == ''">x86</CefSharpPlatformTarget> |
| 124 | + <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == 'Win32'">x86</CefSharpPlatformTarget> |
| 125 | + <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(Prefer32Bit)' == 'true' AND '$(CefSharpAnyCpuSupport)' == ''">x86</CefSharpPlatformTarget> |
116 | 126 | <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTargetOverride)' != ''">$(CefSharpPlatformTargetOverride)</CefSharpPlatformTarget>
|
117 | 127 |
|
118 | 128 | </PropertyGroup>
|
|
0 commit comments