Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CefSharp x86 dlls are copied to the root #4997

Open
1 task done
Chuprinenko opened this issue Dec 3, 2024 · 1 comment
Open
1 task done

CefSharp x86 dlls are copied to the root #4997

Chuprinenko opened this issue Dec 3, 2024 · 1 comment

Comments

@Chuprinenko
Copy link

Is there an existing issue for this?

  • I have searched both open/closed issues, no issue already exists.

CefSharp Version

131.2.70

Operating System

Windows 10

Architecture

AnyCPU

.Net Version

net 4.8

Implementation

WPF

Reproduction Steps

2 projects in my solution solution (both .net framework 4.8, sdk-styled):

  1. Empty library referencing CefSharp package
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net48</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="CefSharp.Common" Version="131.2.70" />
  </ItemGroup>
</Project>
  1. Console app referencing project 1
<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net48</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <ProjectReference Include="..\CefSharpLib\CefSharpLib.csproj" />
  </ItemGroup>
</Project>

Also having these properties set in Directory.Build.props

<Project>
	<PropertyGroup>
		<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
		<CefSharpPlatformTargetOverride>AnyCPU</CefSharpPlatformTargetOverride>
		<CefSharpBuildAction>None</CefSharpBuildAction>
		<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
		<OutputPath>..\_output</OutputPath>
	</PropertyGroup>
</Project>

Steps to reproduce:

  1. Build the solution

Expected behavior

Having common dlls in the root and specific dlss in the corresponding folders:
image

Actual behavior

Dlls from x86 are also copied to the root extremely increasing the size of the output:

image

Regression?

Broken in 121.3.70, before it worked

Known Workarounds

No response

Does this problem also occur in the CEF Sample Application

Not Tested

Other information

No response

@amaitland
Copy link
Member

<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
<CefSharpPlatformTargetOverride>AnyCPU</CefSharpPlatformTargetOverride>
<CefSharpBuildAction>None</CefSharpBuildAction>

These should only be set on your Exe project, not on your library project. CefSharpBuildAction should be NoAction for your library project (the default)

Troubleshooting

Add the following to your csproj/vbproj file at the end

<Target Name="CefSharpAfterBuildDebug" AfterTargets="AfterBuild">
    <CallTarget Targets="CefSharpAfterBuildDiagnostic" />
</Target>

Change your MSBuild project output verbosity to Normal:

1. Go to Tools->Options menu in VS
2. Open Projects and Solutions->Build and Run
3. Change the value of the MSBuild project build output verbosity. Pick Normal or higher

After you build, check the output window for a block of text that looks like:

>Target CefSharpAfterBuildDebug:
>  Target CefSharpAfterBuildDiagnostic:
>    CefSharp After Build Diagnostic
>    CefSharpBuildAction = Content
>    CefSharpPropertiesLoaded = true
>    CefSharpTargetDir =
>    CefSharpTargetDirAnyCpu32 = x86\
>    CefSharpTargetDirAnyCpu64 = x64\
>    RuntimeIdentifier = win7-x64
>    EffectivePlatform =
>    Platform = x64
>    PlatformName = x64
>    Platforms = x86;x64;AnyCPU
>    PlatformTarget = x64
>    CefSharpPlatformTarget = x64
>    PlatformTargetAsMSBuildArchitecture = x64
>    TargetFramework = net472
>    TargetFrameworkVersion = v4.7.2
>    libcef.dll exists = bin.net472\x64\Debug\net472\libcef.dll
>    CefSharpTransformXmlDllPath = C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\v16.0\Web\Microsoft.Web.Publishing.Tasks.dll
>    NuGetProjectStyle = PackageReference
>    NuGetToolVersion = 5.11.1
>    OutputType = WinExe
>    OutDir = bin.net472\x64\Debug\net472\
>    Prefer32Bit = false

Confirm the PlatformTarget is as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants