Skip to content

NetCore - Generate Reference Assemblies building with VS2022#4559

Merged
amaitland merged 2 commits intocefsharp:masterfrom
developersthinksmartbox:bugfix/ref-assemblies-missing-net-6
Aug 3, 2023
Merged

NetCore - Generate Reference Assemblies building with VS2022#4559
amaitland merged 2 commits intocefsharp:masterfrom
developersthinksmartbox:bugfix/ref-assemblies-missing-net-6

Conversation

@developersthinksmartbox
Copy link
Contributor

Fixes: #4558

Summary: The .NET 6.0 SDK introduced a breaking change meaning that reference assemblies are no longer automatically copied from the intermediate build directory to the output directory. An additional MsBuild property is now required.

Changes: Included the ProduceReferenceAssemblyInOutDir in all required netcore projects

How Has This Been Tested?
Has been tested using build.ps1 script (VS2022) and building in Visual Studio 2022.
Has not been tested with VS2019 build tools

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Updated documentation

Checklist:

  • Tested the code (if applicable)
  • Commented my code
  • Changed the documentation(if applicable)
  • New files have a license disclaimer
  • The formatting is consistent with the project (project supports .editorconfig)

@AppVeyorBot
Copy link

Build CefSharp 115.3.70-CI4806 failed (commit 893c78725b by @)

@developersthinksmartbox developersthinksmartbox force-pushed the bugfix/ref-assemblies-missing-net-6 branch from 1295e94 to e505139 Compare July 27, 2023 13:40
@AppVeyorBot
Copy link

Build CefSharp 115.3.70-CI4807 failed (commit 869ebd3611 by @)

@developersthinksmartbox
Copy link
Contributor Author

Hey @amaitland, apologies, I got some build errors in the CI that I'm not getting locally. They seem to relate to the framework CefSharp.sln build(s) that I don't think my code affects. Have I done something wrong?

I will get a machine with VS2019 and make sure I can build the .NET framework and core solutions with my changeset.

@amaitland
Copy link
Member

The latest commit to master was built successfully see https://ci.appveyor.com/project/cefsharp/cefsharp/builds/47557098

that I don't think my code affects

Not directly, indirectly the property may have some unintended consequences when using VS2019. The netcore build maybe outputting something into the default bin\obj directory used by Net Framework build. I'm speculating at this point.

It may need to be conditionally set. For a quick test try something like:

<ProduceReferenceAssemblyInOutDir Condition="'$(VisualStudioVersion)'=='17.0'">true</ProduceReferenceAssemblyInOutDir>

@developersthinksmartbox developersthinksmartbox force-pushed the bugfix/ref-assemblies-missing-net-6 branch from 572ae5e to 8a46ef0 Compare July 31, 2023 08:07
@AppVeyorBot
Copy link

Build CefSharp 115.3.110-CI4812 failed (commit 3d61c09eee by @)

@developersthinksmartbox developersthinksmartbox force-pushed the bugfix/ref-assemblies-missing-net-6 branch from 8a46ef0 to ec11db0 Compare July 31, 2023 09:27
@AppVeyorBot
Copy link

Build CefSharp 115.3.110-CI4813 completed (commit d9b9c94a89 by @)

@developersthinksmartbox developersthinksmartbox force-pushed the bugfix/ref-assemblies-missing-net-6 branch from ec11db0 to 6756cb1 Compare July 31, 2023 11:00
@developersthinksmartbox
Copy link
Contributor Author

developersthinksmartbox commented Jul 31, 2023

Thanks @amaitland, a build with that change has successfully run although I'm not totally convinced of the cause of the original failure. I tried building my original changeset with VS2019 on our build server (by invoking build.ps1 with no additional arguments) and it compiled successfully.

My understanding is that the netcore builds use the bin.netcore and obj.netcore directories instead of the conventional bin/obj ones so I'm not sure how this was interacting with the framework builds. Also, looking at the build output of the AppVeyor job I see we start with a git clone (so the environment is clean) and then do the framework build before the netcore one.

Looking at Build CefSharp 115.3.70-CI4807 failed, there is an error in the job at line 120 which indicates the cef runtime package failed to download from the cefsharp-myget feed despite it being listed there:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(131,5): error : The feed 'cefsharp-myget [https://www.myget.org/F/cefsharp/]' lists package 'chromiumembeddedframework.runtime.115.3.7' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again. [C:\projects\cefsharp\CefSharp3.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(131,5): error :   Unable to find package 'chromiumembeddedframework.runtime.115.3.7'. [C:\projects\cefsharp\CefSharp3.sln]

The first build failure also shows this problem. Perhaps this was just a temporary connectivity issue?

I'm happy to leave your recommended change in or take it out and try another build. Whatever you'd prefer. :)

@developersthinksmartbox developersthinksmartbox force-pushed the bugfix/ref-assemblies-missing-net-6 branch from ebdad9f to 9e061f4 Compare July 31, 2023 11:13
@AppVeyorBot
Copy link

Build CefSharp 115.3.110-CI4817 failed (commit 80db52cfa6 by @)

@amaitland amaitland changed the title Ensure reference assemblies are copied to output folders NetCore - Generate Reference Assemblies building with VS2022 Aug 3, 2023
@amaitland amaitland linked an issue Aug 3, 2023 that may be closed by this pull request
1 task
The .NET 6.0 SDK introduced a breaking change meaning that reference
assemblies are no longer automatically copied from the intermediate
build directory to the output directory. An additional MsBuild property
is now required.
@amaitland amaitland force-pushed the bugfix/ref-assemblies-missing-net-6 branch from 9e061f4 to d1d17c3 Compare August 3, 2023 20:02
@amaitland
Copy link
Member

I'm happy to leave your recommended change in or take it out and try another build.

This looks fine. I've asked GitHub to rebase the changes. If AppVeyor builds pass then I'll merge this.

@AppVeyorBot
Copy link

Build CefSharp 115.3.110-CI4826 completed (commit 89cca69b6a by @)

@amaitland amaitland merged commit f75b991 into cefsharp:master Aug 3, 2023
@developersthinksmartbox
Copy link
Contributor Author

Thanks @amaitland! Me and my company appreciate everything you're doing here. ❤

@developersthinksmartbox developersthinksmartbox deleted the bugfix/ref-assemblies-missing-net-6 branch August 14, 2023 10:32
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

Successfully merging this pull request may close these issues.

NetCore - Reference assemblies not generated when building with VS2022

4 participants