2014-03-27 05:44:36 +01:00
<?xml version="1.0" encoding="utf-8"?>
2020-12-16 10:47:34 +10:00
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="CefSharpTransformXmlDllPath">
2021-02-12 14:49:09 +10:00
<!--
MSBuild is finding CefSharp.Core.Runtime.dll from the x86 folder and copying it to the bin folder which is a problem for AnyCPU
2021-03-02 10:35:08 +10:00
and when CefSharpTargetDir is used to move the files into a sub folder.
2021-02-12 14:49:09 +10:00
We manually remove CefSharp.Core.Runtime.dll from ReferenceCopyLocalPaths
https://thomasfreudenberg.com/archive/2012/11/21/dont-copy-my-referenced-assemblies/
-->
2021-03-02 10:35:08 +10:00
<Target Name="CefSharpExcludeCoreRuntimeAfterResolveAssemblyReferences" AfterTargets="ResolveAssemblyReferences" Condition="('$(CefSharpPlatformTarget)' == 'AnyCPU' OR '$(CefSharpTargetDir)' != '') AND $(TargetFrameworkVersion.StartsWith('v4.'))">
2021-02-12 14:49:09 +10:00
<ItemGroup>
2021-03-02 10:35:08 +10:00
<ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.dll" />
<ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.pdb" />
<ReferenceCopyLocalPaths Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.xml" />
2021-02-12 14:49:09 +10:00
</ItemGroup>
</Target>
2021-02-23 10:28:15 +10:00
<!--
2021-03-02 10:35:08 +10:00
For VS2017 when publishing x86/x64 there's CefSharp.Core.Runtime.dll references in both _DeploymentManifestDependencies and _DeploymentManifestFiles
This causes an Error occurred writing to hard disk exception, so we remove one (we leave the dependency and just remove the file reference).
2021-02-23 10:28:15 +10:00
-->
<Target Name="CefSharpExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' != 'AnyCPU' AND $(TargetFrameworkVersion.StartsWith('v4.'))">
<ItemGroup>
2021-03-02 10:35:08 +10:00
<_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.dll" />
<_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.pdb" />
<_DeploymentManifestFiles Remove="$(MSBuildThisFileDirectory)..\CefSharp\$(PlatformTarget)\CefSharp.Core.Runtime.xml" />
2021-02-23 10:28:15 +10:00
</ItemGroup>
</Target>
<!--
For AnyCPU ClickOnce Publish Remove CefSharp.Core.Runtime.dll for being included in the bin folder
TODO: Publish AnyCPU still not working, requires some tweaking as CefSharp.dll file isn't being copied to the x64 folder.
-->
<Target Name="CefSharpAnyCPUExcludeCoreRuntimeBeforeGenerateApplicationManifest" BeforeTargets="GenerateApplicationManifest" Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND $(TargetFrameworkVersion.StartsWith('v4.'))">
2021-02-12 14:49:09 +10:00
<ItemGroup>
<_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.dll" />
2021-03-02 10:35:08 +10:00
<_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.pdb" />
<_DeploymentManifestDependencies Remove="$(MSBuildThisFileDirectory)..\CefSharp\x86\CefSharp.Core.Runtime.xml" />
2021-02-12 14:49:09 +10:00
</ItemGroup>
2021-02-08 17:12:42 +10:00
</Target>
2021-02-12 14:49:09 +10:00
2021-02-08 17:12:42 +10:00
2021-01-27 15:29:10 +10:00
<!--
Add to project file for debuggint purposes
<Target Name="CefSharpAfterBuildDebug" AfterTargets="AfterBuild">
<CallTarget Targets="CefSharpAfterBuildDiagnostic"/>
</Target>
-->
<Target Name="CefSharpAfterBuildDiagnostic">
<Message Importance="high" Text="CefSharp After Build Diagnostic" />
2021-02-04 10:55:30 +10:00
<Message Importance="high" Text="CefSharpBuildAction = $(CefSharpBuildAction)" />
<Message Importance="high" Text="CefSharpTargetDir = $(CefSharpTargetDir)" />
<Message Importance="high" Text="CefSharpTargetDirAnyCpu32 = $(CefSharpTargetDirAnyCpu32)" />
<Message Importance="high" Text="CefSharpTargetDirAnyCpu64 = $(CefSharpTargetDirAnyCpu64)" />
<Message Importance="high" Text="RuntimeIdentifier = $(RuntimeIdentifier)" />
2021-02-08 16:33:37 +10:00
<Message Importance="high" Text="Platform = $(Platform)" />
2021-03-02 10:35:08 +10:00
<Message Importance="high" Text="PlatformName = $(PlatformName)" />
<Message Importance="high" Text="Platforms = $(Platforms)" />
<Message Importance="high" Text="PlatformTarget = $(PlatformTarget)" />
<Message Importance="high" Text="CefSharpPlatformTarget = $(CefSharpPlatformTarget)" />
<Message Importance="high" Text="PlatformTargetAsMSBuildArchitecture = $(PlatformTargetAsMSBuildArchitecture)" />
<Message Importance="high" Text="TargetFramework = $(TargetFramework)" />
<Message Importance="high" Text="TargetFrameworkVersion = $(TargetFrameworkVersion)" />
2021-02-04 10:55:30 +10:00
<Message Importance="high" Text="libcef.dll exists = $(OutDir)$(CefSharpTargetDir)libcef.dll" Condition="Exists('$(OutDir)$(CefSharpTargetDir)libcef.dll')" />
<Message Importance="high" Text="libcef.dll exists AnyCPU(x86) = $(OutDir)$(CefSharpTargetDirAnyCpu32)libcef.dll" Condition="Exists('$(OutDir)$(CefSharpTargetDirAnyCpu32)libcef.dll')" />
<Message Importance="high" Text="libcef.dll exists AnyCPU(x64) = $(OutDir)$(CefSharpTargetDirAnyCpu64)libcef.dll" Condition="Exists('$(OutDir)$(CefSharpTargetDirAnyCpu64)libcef.dll')" />
<Message Importance="high" Text="CefSharpTransformXmlDllPath = $(CefSharpTransformXmlDllPath)" />
<Message Importance="high" Text="NuGetProjectStyle = $(NuGetProjectStyle)" />
<Message Importance="high" Text="OutDir = $(OutDir)" />
2021-01-27 15:29:10 +10:00
</Target>
2021-01-09 16:00:14 +10:00
2020-12-16 10:47:34 +10:00
<PropertyGroup>
2021-01-08 15:09:37 +10:00
<!--
Used for AnyCPU transforming of app.config
If https://www.nuget.org/packages/MSBuild.Microsoft.VisualStudio.Web.targets/ package is installed
we'll attempt to use the task from there, otherwise see if it's installed as part of Visual Studio
If not installed then we'll fallback to the old behaviour (user has to manage AnyCPU themselves)
-->
<CefSharpTransformXmlDllPath Condition="$(VSToolsPath) == ''">$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Web\Microsoft.Web.Publishing.Tasks.dll</CefSharpTransformXmlDllPath>
<CefSharpTransformXmlDllPath Condition="$(VSToolsPath) != ''" >$(VSToolsPath)\Web\Microsoft.Web.Publishing.Tasks.dll</CefSharpTransformXmlDllPath>
2020-12-16 10:47:34 +10:00
</PropertyGroup>
2016-06-20 11:34:47 +10:00
2018-05-01 12:05:21 +10:00
<PropertyGroup>
2021-01-08 15:09:37 +10:00
<!--
2021-01-27 15:29:10 +10:00
Allowable options are None, Content, NoAction.
2021-02-04 15:06:36 +10:00
None is the default (same as selecting the None Build Action in Visual Studio) for Nuget packages.config
Content is the default (same as selecting the None Build Action in Visual Studio) for Nuget PackageReference
2021-03-02 10:35:08 +10:00
Technically the older Non-SDK Style project can use PackageReference under VS2019 (possibly VS2017 as well),
so we use NuGetProjectStyle which is defined in the .nuget.g.props file for projects using PackageReference
2021-01-08 15:09:37 +10:00
-->
2021-02-04 15:06:36 +10:00
<CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(NuGetProjectStyle)' != 'PackageReference'">None</CefSharpBuildAction>
<CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(NuGetProjectStyle)' == 'PackageReference'">Content</CefSharpBuildAction>
2021-01-14 11:32:09 +10:00
<CefSharpTargetDir Condition="'$(CefSharpTargetDir)' == ''"></CefSharpTargetDir>
2021-01-14 15:06:57 +10:00
<!-- Ideally we could use EnsureTrailingSlash, was only added on 2016 so unlikely supported in older version of VS -->
<CefSharpTargetDir Condition="'$(CefSharpTargetDir)' != '' AND !HasTrailingSlash('$(CefSharpTargetDir)')">$(CefSharpTargetDir)\</CefSharpTargetDir>
2021-01-14 11:32:09 +10:00
<CefSharpTargetDirAnyCpu32>$(CefSharpTargetDir)x86\</CefSharpTargetDirAnyCpu32>
<CefSharpTargetDirAnyCpu64>$(CefSharpTargetDir)x64\</CefSharpTargetDirAnyCpu64>
2021-03-02 10:35:08 +10:00
<!--
For Sdk Projects the PlatformTarget is unreliable (https://github.com/dotnet/sdk/issues/1560)
It can incorrectly be AnyCPU when it is infact an arch specific build
When AnyCPU and Prefer32Bit we just set the PlatformTarget to x86 (only when CefSharpAnyCpuSupport is empty)
-->
<CefSharpPlatformTarget>$(PlatformTarget)</CefSharpPlatformTarget>
<CefSharpPlatformTarget Condition="'$(PlatformTargetAsMSBuildArchitecture)' == 'x86' OR '$(PlatformTargetAsMSBuildArchitecture)' == 'x64'">$(PlatformTargetAsMSBuildArchitecture)</CefSharpPlatformTarget>
<CefSharpPlatformTarget Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(Prefer32Bit)' == 'true' AND '$(CefSharpAnyCpuSupport)' == ''">x86</CefSharpPlatformTarget>
<CefSharpPlatformTarget Condition="'$(CefSharpPlatformTargetOverride)' != ''">$(CefSharpPlatformTargetOverride)</CefSharpPlatformTarget>
2018-05-01 12:05:21 +10:00
</PropertyGroup>
2020-12-16 10:47:34 +10:00
<Choose>
<!--
2021-01-08 15:09:37 +10:00
For .Net Core/Net5 when there's no runtime identifier specified then our lib files will be in the runtimes folders
we copy our unmanaged resources into the sub folder when required
-->
<When Condition="'$(RuntimeIdentifier)' == '' AND ($(TargetFramework.StartsWith('netcoreapp3')) OR $(TargetFramework.StartsWith('net5')))">
<Choose>
2021-02-08 16:33:37 +10:00
<When Condition="'$(CefSharpPlatformTarget)' == 'x64'">
2021-01-08 15:09:37 +10:00
<PropertyGroup>
2021-01-14 11:32:09 +10:00
<CefSharpTargetDir>runtimes\win-x64\lib\netcoreapp3.0\</CefSharpTargetDir>
2020-12-16 10:47:34 +10:00
</PropertyGroup>
2021-01-08 15:09:37 +10:00
</When>
2021-02-08 16:33:37 +10:00
<When Condition="'$(CefSharpPlatformTarget)' == 'x86'">
2021-01-08 15:09:37 +10:00
<PropertyGroup>
2021-01-14 11:32:09 +10:00
<CefSharpTargetDir>runtimes\win-x86\lib\netcoreapp3.0\</CefSharpTargetDir>
2020-12-16 10:47:34 +10:00
</PropertyGroup>
2021-01-08 15:09:37 +10:00
</When>
2021-02-08 16:33:37 +10:00
<When Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU'">
2021-01-08 15:09:37 +10:00
<PropertyGroup>
2021-01-14 11:32:09 +10:00
<CefSharpTargetDirAnyCpu32>runtimes\win-x86\lib\netcoreapp3.0\</CefSharpTargetDirAnyCpu32>
<CefSharpTargetDirAnyCpu64>runtimes\win-x64\lib\netcoreapp3.0\</CefSharpTargetDirAnyCpu64>
2020-12-16 10:47:34 +10:00
</PropertyGroup>
2021-01-08 15:09:37 +10:00
</When>
</Choose>
</When>
2021-01-14 15:06:57 +10:00
<!--
When CefSharpTargetDir is specified for x86/x64 platforms the files are included in a sub directory,
The CefSharp.dll file required by the BrowserSubProcess isn't copied by default and won't start, so we include an extra
copy.
-->
2021-02-08 16:33:37 +10:00
<When Condition="'$(CefSharpTargetDir)' != '' AND $(TargetFrameworkVersion.StartsWith('v4.')) AND '$(CefSharpPlatformTarget)' != 'AnyCPU'">
2021-01-14 15:02:11 +10:00
<Choose>
2021-01-14 15:06:57 +10:00
<When Condition="'$(CefSharpBuildAction)' == 'None'">
<ItemGroup>
2021-02-23 10:28:15 +10:00
<None Include="@(CefSharpCommonManagedDll)">
2021-01-14 15:06:57 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
</ItemGroup>
</When>
<When Condition="'$(CefSharpBuildAction)' == 'Content'">
<ItemGroup>
2021-02-23 10:28:15 +10:00
<Content Include="@(CefSharpCommonManagedDll)">
2021-01-14 15:06:57 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
</ItemGroup>
</When>
</Choose>
2021-01-14 15:02:11 +10:00
</When>
2020-12-16 10:47:34 +10:00
</Choose>
2018-05-01 12:05:21 +10:00
2021-01-08 15:09:37 +10:00
<Choose>
<When Condition="'$(CefSharpBuildAction)' == 'None'">
<Choose>
2021-02-08 16:33:37 +10:00
<When Condition="'$(CefSharpPlatformTarget)' == 'x64'">
2021-01-08 15:09:37 +10:00
<ItemGroup>
<None Include="@(CefRedist64)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
<None Include="@(CefSharpCommonBinaries64)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
</ItemGroup>
</When>
2021-02-08 16:33:37 +10:00
<When Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU'">
2021-01-08 15:09:37 +10:00
<ItemGroup>
<None Include="@(CefRedist32)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu32)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
<None Include="@(CefRedist64)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu64)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
<None Include="@(CefSharpCommonBinaries32)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu32)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
<None Include="@(CefSharpCommonBinaries64)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu64)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
<!--
Include CefSharp.dll and CefSharp.Core.dll (we only need CefSharp.dll but it's easier to include both)
in the arch specific folders as required by the BrowserSubProcess.
-->
2021-02-23 10:28:15 +10:00
<None Include="@(CefSharpCommonManagedDll)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu32)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
2021-02-23 10:28:15 +10:00
<None Include="@(CefSharpCommonManagedDll)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu64)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
</ItemGroup>
</When>
<!-- x86 and Win32-->
<Otherwise>
<ItemGroup>
<None Include="@(CefRedist32)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
<None Include="@(CefSharpCommonBinaries32)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</None>
</ItemGroup>
</Otherwise>
</Choose>
</When>
<When Condition="'$(CefSharpBuildAction)' == 'Content'">
<Choose>
2021-02-08 16:33:37 +10:00
<When Condition="'$(CefSharpPlatformTarget)' == 'x64'">
2021-01-08 15:09:37 +10:00
<ItemGroup>
<Content Include="@(CefRedist64)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
<Content Include="@(CefSharpCommonBinaries64)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
</ItemGroup>
</When>
2021-02-08 16:33:37 +10:00
<When Condition="'$(CefSharpPlatformTarget)' == 'AnyCPU'">
2021-01-08 15:09:37 +10:00
<ItemGroup>
<Content Include="@(CefRedist32)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu32)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
<Content Include="@(CefRedist64)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu64)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
<Content Include="@(CefSharpCommonBinaries32)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu32)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
<Content Include="@(CefSharpCommonBinaries64)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu64)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
<!--
Include CefSharp.dll and CefSharp.Core.dll (we only need CefSharp.dll but it's easier to include both)
in the arch specific folders as required by the BrowserSubProcess.
-->
2021-02-23 10:28:15 +10:00
<Content Include="@(CefSharpCommonManagedDll)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu32)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
2021-02-23 10:28:15 +10:00
<Content Include="@(CefSharpCommonManagedDll)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDirAnyCpu64)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
</ItemGroup>
</When>
<!-- x86 and Win32-->
<Otherwise>
<ItemGroup>
<Content Include="@(CefRedist32)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
<Content Include="@(CefSharpCommonBinaries32)">
2021-01-14 11:32:09 +10:00
<Link>$(CefSharpTargetDir)%(RecursiveDir)%(FileName)%(Extension)</Link>
2021-01-08 15:09:37 +10:00
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<PublishState>Included</PublishState>
<Visible>false</Visible>
</Content>
</ItemGroup>
</Otherwise>
</Choose>
</When>
2020-12-16 10:47:34 +10:00
</Choose>
<!--
For AnyCPU we use a Transform to add entries to app.config if possible
Otherwise throw error to alert user they need to perform additional action
-->
2021-02-08 16:33:37 +10:00
<UsingTask TaskName="TransformXml" AssemblyFile="$(CefSharpTransformXmlDllPath)" Condition="Exists('$(CefSharpTransformXmlDllPath)') AND '$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(CefSharpAnyCpuSupport)' == ''" />
2020-12-16 10:47:34 +10:00
2021-02-04 18:48:39 +10:00
<Target Name="CefSharpCommonAnyCPUConfigTransform" AfterTargets="_CopyAppConfigFile" Condition="'@(AppConfigWithTargetPath)' != '' AND Exists('$(CefSharpTransformXmlDllPath)') AND '$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(CefSharpAnyCpuSupport)' == ''">
2021-01-29 14:48:33 +10:00
<TransformXml Source="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')" Transform="$(MSBuildThisFileDirectory)..\build\app.config.x86.transform" Destination="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')"/>
<TransformXml Source="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')" Transform="$(MSBuildThisFileDirectory)..\build\app.config.x64.transform" Destination="@(AppConfigWithTargetPath->'$(OutDir)%(TargetPath)')"/>
2020-12-16 10:47:34 +10:00
</Target>
2021-02-04 18:48:39 +10:00
<Target Name="CefSharpPlatformCheck" BeforeTargets="ResolveAssemblyReferences" Condition="('@(AppConfigWithTargetPath)' == '' OR !Exists('$(CefSharpTransformXmlDllPath)')) AND '$(CefSharpPlatformTarget)' == 'AnyCPU' AND '$(CefSharpAnyCpuSupport)' != 'true'">
2021-02-08 16:33:37 +10:00
<Error Text="$(MSBuildThisFileName) is unable to proceeed as your current PlatformTarget is '$(CefSharpPlatformTarget)'. To target AnyCPU please read https://github.com/cefsharp/CefSharp/issues/1714. Alternatively change your PlatformTarget to x86 or x64 and the relevant files will be copied automatically." HelpKeyword="CefSharpSolutionPlatformCheck" />
2020-12-16 10:47:34 +10:00
</Target>
2021-01-09 16:00:14 +10:00
<!--
Issue https://github.com/dotnet/project-system/issues/4158
The None/Content entries aren't picked up as the .targets file doesn't exist before the Nuget restore (only when using packages.config)
2021-01-29 14:48:33 +10:00
So in that scenario we display a mssage to the user. Close/reopen the project and the None/Content entries will work as above.
I have attempted to copy the files via a Copy Task, unfortunately the .props entries aren't accessible either so that's not feasible.
2021-01-09 16:00:14 +10:00
-->
2021-02-15 15:38:58 +10:00
<Target Name="CefSharpCopyFilesAfterNugetRestore32" AfterTargets="AfterBuild" Condition="'$(NuGetProjectStyle)' != 'PackageReference' AND !Exists('$(OutDir)$(CefSharpTargetDir)libcef.dll') AND '$(CefSharpBuildAction)' != 'NoAction' AND '$(CefSharpPlatformTarget)' == 'x86'">
2021-01-29 14:48:33 +10:00
<Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Please close and re-open $(MSBuildProjectFile)." />
2021-01-15 14:41:23 +10:00
</Target>
2021-01-09 16:00:14 +10:00
2021-02-15 15:38:58 +10:00
<Target Name="CefSharpCopyFilesAfterNugetRestore64" AfterTargets="AfterBuild" Condition="'$(NuGetProjectStyle)' != 'PackageReference' AND !Exists('$(OutDir)$(CefSharpTargetDir)libcef.dll') AND '$(CefSharpBuildAction)' != 'NoAction' AND '$(CefSharpPlatformTarget)' == 'x64'">
2021-01-29 14:48:33 +10:00
<Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Please close and re-open $(MSBuildProjectFile)." />
2021-01-15 14:41:23 +10:00
</Target>
2021-01-09 16:00:14 +10:00
2021-02-15 15:38:58 +10:00
<Target Name="CefSharpCopyFilesAfterNugetRestoreAnyCPU" AfterTargets="AfterBuild" Condition="'$(NuGetProjectStyle)' != 'PackageReference' AND !Exists('$(OutDir)$(CefSharpTargetDirAnyCpu32)libcef.dll') AND '$(CefSharpBuildAction)' != 'NoAction' AND '$(CefSharpPlatformTarget)' == 'AnyCPU'">
2021-01-29 14:48:33 +10:00
<Message Importance="high" Text="CefSharp - Files were not copied by MSBuild after Nuget install/restore! Please close and re-open $(MSBuildProjectFile)." />
2021-01-15 14:41:23 +10:00
</Target>
2020-12-16 10:47:34 +10:00
</Project>