|
2 | 2 | <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="CefSharpTransformXmlDllPath"> |
3 | 3 | <!-- |
4 | 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. |
5 | 6 | We manually remove CefSharp.Core.Runtime.dll from ReferenceCopyLocalPaths |
6 | 7 | https://thomasfreudenberg.com/archive/2012/11/21/dont-copy-my-referenced-assemblies/ |
7 | 8 | --> |
8 | | - <Target Name="CefSharpExcludeCoreRuntimeAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND $(TargetFrameworkVersion.StartsWith('v4.'))"> |
| 9 | + <Target Name="CefSharpExcludeCoreRuntimeAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="('$(CefSharpPlatformTarget)' == 'AnyCPU' OR '$(CefSharpTargetDir)' != '') AND $(TargetFrameworkVersion.StartsWith('v4.'))"> |
9 | 10 | <ItemGroup> |
10 | | - <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.dll" /> |
11 | | - <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.pdb" /> |
12 | | - <ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.xml" /> |
| 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" /> |
13 | 14 | </ItemGroup> |
14 | 15 | </Target> |
15 | 16 |
|
16 | 17 | <!-- |
17 | | - For VS2017 when publishing x86/x64 there's CefSharp.Core.Runtime.dll references in both _DeploymentManifestDependencies and _DeploymentManifestFiles |
18 | | - This causes an Error occurred writing to hard disk exception, so we remove one (we leve the dependency and just remove the file reference. |
| 18 | + For VS2017 when publishing x86/x64 there's CefSharp.Core.Runtime.dll references in both _DeploymentManifestDependencies and _DeploymentManifestFiles |
| 19 | + This causes an Error occurred writing to hard disk exception, so we remove one (we leave the dependency and just remove the file reference). |
19 | 20 | --> |
20 | 21 | <Target Name="CefSharpExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' != 'AnyCPU' AND $(TargetFrameworkVersion.StartsWith('v4.'))"> |
21 | 22 | <ItemGroup> |
22 | | - <_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.dll" /> |
23 | | - <_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.pdb" /> |
24 | | - <_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.xml" /> |
| 23 | + <_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.dll" /> |
| 24 | + <_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.pdb" /> |
| 25 | + <_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.xml" /> |
25 | 26 | </ItemGroup> |
26 | 27 | </Target> |
27 | 28 |
|
|
32 | 33 | <Target Name="CefSharpAnyCPUExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND $(TargetFrameworkVersion.StartsWith('v4.'))"> |
33 | 34 | <ItemGroup> |
34 | 35 | <_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.dll" /> |
35 | | - <_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.pdb" /> |
36 | | - <_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.xml" /> |
| 36 | + <_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.pdb" /> |
| 37 | + <_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.xml" /> |
37 | 38 | </ItemGroup> |
38 | 39 | </Target> |
39 | 40 |
|
|
52 | 53 | <Message Importance="high" Text="CefSharpTargetDirAnyCpu64 = $(CefSharpTargetDirAnyCpu64)" /> |
53 | 54 | <Message Importance="high" Text="RuntimeIdentifier = $(RuntimeIdentifier)" /> |
54 | 55 | <Message Importance="high" Text="Platform = $(Platform)" /> |
55 | | - <Message Importance="high" Text="PlatformName = $(PlatformName)" /> |
56 | | - <Message Importance="high" Text="Platforms = $(Platforms)" /> |
57 | | - <Message Importance="high" Text="PlatformTarget = $(PlatformTarget)" /> |
58 | | - <Message Importance="high" Text="CefSharpPlatformTarget = $(CefSharpPlatformTarget)" /> |
59 | | - <Message Importance="high" Text="PlatformTargetAsMSBuildArchitecture = $(PlatformTargetAsMSBuildArchitecture)" /> |
60 | | - <Message Importance="high" Text="TargetFramework = $(TargetFramework)" /> |
61 | | - <Message Importance="high" Text="TargetFrameworkVersion = $(TargetFrameworkVersion)" /> |
| 56 | + <Message Importance="high" Text="PlatformName = $(PlatformName)" /> |
| 57 | + <Message Importance="high" Text="Platforms = $(Platforms)" /> |
| 58 | + <Message Importance="high" Text="PlatformTarget = $(PlatformTarget)" /> |
| 59 | + <Message Importance="high" Text="CefSharpPlatformTarget = $(CefSharpPlatformTarget)" /> |
| 60 | + <Message Importance="high" Text="PlatformTargetAsMSBuildArchitecture = $(PlatformTargetAsMSBuildArchitecture)" /> |
| 61 | + <Message Importance="high" Text="TargetFramework = $(TargetFramework)" /> |
| 62 | + <Message Importance="high" Text="TargetFrameworkVersion = $(TargetFrameworkVersion)" /> |
62 | 63 | <Message Importance="high" Text="libcef.dll exists = $(OutDir)$(CefSharpTargetDir)libcef.dll" Condition="Exists('$(OutDir)$(CefSharpTargetDir)libcef.dll')" /> |
63 | 64 | <Message Importance="high" Text="libcef.dll exists AnyCPU(x86) = $(OutDir)$(CefSharpTargetDirAnyCpu32)libcef.dll" Condition="Exists('$(OutDir)$(CefSharpTargetDirAnyCpu32)libcef.dll')" /> |
64 | 65 | <Message Importance="high" Text="libcef.dll exists AnyCPU(x64) = $(OutDir)$(CefSharpTargetDirAnyCpu64)libcef.dll" Condition="Exists('$(OutDir)$(CefSharpTargetDirAnyCpu64)libcef.dll')" /> |
|
83 | 84 | Allowable options are None, Content, NoAction. |
84 | 85 | None is the default (same as selecting the None Build Action in Visual Studio) for Nuget packages.config |
85 | 86 | Content is the default (same as selecting the None Build Action in Visual Studio) for Nuget PackageReference |
86 | | - Technically the older Non-SDK Style project can use PackageReference under VS2019 (possibly VS2017 as well), |
87 | | - so we use NuGetProjectStyle which is defined in the .nuget.g.props file for projects using PackageReference |
| 87 | + Technically the older Non-SDK Style project can use PackageReference under VS2019 (possibly VS2017 as well), |
| 88 | + so we use NuGetProjectStyle which is defined in the .nuget.g.props file for projects using PackageReference |
88 | 89 | --> |
89 | 90 | <CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(NuGetProjectStyle)' != 'PackageReference'">None</CefSharpBuildAction> |
90 | 91 | <CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(NuGetProjectStyle)' == 'PackageReference'">Content</CefSharpBuildAction> |
|
93 | 94 | <CefSharpTargetDir Condition="'$(CefSharpTargetDir)' != '' AND !HasTrailingSlash('$(CefSharpTargetDir)')">$(CefSharpTargetDir)\</CefSharpTargetDir> |
94 | 95 | <CefSharpTargetDirAnyCpu32>$(CefSharpTargetDir)x86\</CefSharpTargetDirAnyCpu32> |
95 | 96 | <CefSharpTargetDirAnyCpu64>$(CefSharpTargetDir)x64\</CefSharpTargetDirAnyCpu64> |
96 | | - <!-- |
97 | | - For Sdk Projects the PlatformTarget is unreliable (https://github.com/dotnet/sdk/issues/1560) |
98 | | - It can incorrectly be AnyCPU when it is infact an arch specific build |
99 | | - When AnyCPU and Prefer32Bit we just set the PlatformTarget to x86 (only when CefSharpAnyCpuSupport is empty) |
100 | | - --> |
101 | | - <CefSharpPlatformTarget>$(PlatformTarget)</CefSharpPlatformTarget> |
102 | | - <CefSharpPlatformTarget Condition="'$(PlatformTargetAsMSBuildArchitecture)' == 'x86' OR '$(PlatformTargetAsMSBuildArchitecture)' == 'x64'">$(PlatformTargetAsMSBuildArchitecture)</CefSharpPlatformTarget> |
103 | | - <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(Prefer32Bit)' == 'true' AND '$(CefSharpAnyCpuSupport)' == ''">x86</CefSharpPlatformTarget> |
104 | | - <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTargetOverride)' != ''">$(CefSharpPlatformTargetOverride)</CefSharpPlatformTarget> |
105 | | - |
| 97 | + <!-- |
| 98 | + For Sdk Projects the PlatformTarget is unreliable (https://github.com/dotnet/sdk/issues/1560) |
| 99 | + It can incorrectly be AnyCPU when it is infact an arch specific build |
| 100 | + When AnyCPU and Prefer32Bit we just set the PlatformTarget to x86 (only when CefSharpAnyCpuSupport is empty) |
| 101 | + --> |
| 102 | + <CefSharpPlatformTarget>$(PlatformTarget)</CefSharpPlatformTarget> |
| 103 | + <CefSharpPlatformTarget Condition="'$(PlatformTargetAsMSBuildArchitecture)' == 'x86' OR '$(PlatformTargetAsMSBuildArchitecture)' == 'x64'">$(PlatformTargetAsMSBuildArchitecture)</CefSharpPlatformTarget> |
| 104 | + <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(Prefer32Bit)' == 'true' AND '$(CefSharpAnyCpuSupport)' == ''">x86</CefSharpPlatformTarget> |
| 105 | + <CefSharpPlatformTarget Condition="'$(CefSharpPlatformTargetOverride)' != ''">$(CefSharpPlatformTargetOverride)</CefSharpPlatformTarget> |
| 106 | + |
106 | 107 | </PropertyGroup> |
107 | 108 |
|
108 | 109 | <Choose> |
|
0 commit comments