Skip to content

Commit 51df549

Browse files
committed
Nuget - Change default CefSharpBuildAction for Exe/WinExe projects when using packages.config
- For Non library projects that use packages.config the default is now Content which should simplify clickonce support For libraries the default will remain as None - For NetCore projects CefSharpBuildAction Content is mapped to default to support upgrading users Technically this is a breaking change, user impact is expected to be low and can be overridden to restore the previous behaviour in the edge cases. Issue #4062
1 parent 86877f7 commit 51df549

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

NuGet/CefSharp.Common.targets

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,21 @@
9696
<PropertyGroup>
9797
<!--
9898
Allowable options are None, Content, NoAction.
99-
None is the default (same as selecting the None Build Action in Visual Studio) for Nuget packages.config
100-
Content is the default (same as selecting the None Build Action in Visual Studio) for Nuget PackageReference
99+
100+
None is the default (same as selecting the None Build Action in Visual Studio) for Nuget packages.config
101+
for WinExe/Exe projects (anything that's not Library) see https://github.com/cefsharp/CefSharp/issues/4062
102+
None will copy the dependenceis to a directly referencing project file which is useful for library projects
103+
that target packages.config as buildTransitive is not supported.
104+
105+
Content is the default (same as selecting the Content Build Action in Visual Studio) for Nuget PackageReference
106+
and WinExe/Exe projects (anything that's not Library)
101107
Technically the older Non-SDK Style project can use PackageReference under VS2019 (possibly VS2017 as well),
102108
so we use NuGetProjectStyle which is defined in the .nuget.g.props file for projects using PackageReference.
103-
For Library projects with Nuget supports buildTransitive we don't include our additional files and packages, the transitive reference should flow directly to the consuming projects.
104109
For class libraries that are often AnyCPU and consuming Exe/WinExe projects that are x64 or x86 the resulting build output
105-
is polluted with extra copies in sub folders.
110+
is polluted with extra copies in sub folders. Set CefSharpBuildAction to NoAction to avoid copying the files.
106111
-->
107112
<CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(NuGetProjectStyle)' != 'PackageReference'">None</CefSharpBuildAction>
108-
<CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND '$(NuGetProjectStyle)' == 'PackageReference'">Content</CefSharpBuildAction>
113+
<CefSharpBuildAction Condition="'$(CefSharpBuildAction)' == '' AND ('$(NuGetProjectStyle)' == 'PackageReference' OR '$(OutputType)' != 'Library')">Content</CefSharpBuildAction>
109114

110115
<CefSharpTargetDir Condition="'$(CefSharpTargetDir)' == ''"></CefSharpTargetDir>
111116
<!-- Ideally we could use EnsureTrailingSlash, was only added on 2017 so unlikely supported in older version of VS -->

0 commit comments

Comments
 (0)