Skip to content

Conversation

@lauraneto
Copy link
Contributor

The Microsoft.CodeAnalysis.CSharp dependency in the Umbraco.Infrastructure project was only needed for runtime compilation and thus is no longer needed.
It also caused dependency problems with EF Core Design in previous .NET versions, as can be seen in #20421 and #17839. In .NET 10 these issues are no longer present, but if they re-appear we will need to apply a similar fix as in #20474.

I also disabled CPM (Central Package Management) in the Umbraco.Web.UI project, as that can sometimes hide dependency issues consumers might encounter.

This was only needed for runtime compilation and thus is no longer needed in Infrastructure.
It also caused dependency problems with EF Core Design in previous versions.
This will ensure that we face any potential dependency issues consumers are also likely to run into.
Copilot AI review requested due to automatic review settings October 13, 2025 08:35
@lauraneto lauraneto added dependencies Pull requests that update a dependency file area/backend labels Oct 13, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the Microsoft.CodeAnalysis.CSharp dependency from the Umbraco.Infrastructure project, which was only needed for runtime compilation and is no longer required. Additionally, Central Package Management (CPM) is disabled for the Umbraco.Web.UI project to prevent dependency issues that consumers might encounter.

Key changes:

  • Removed Microsoft.CodeAnalysis.CSharp dependency from Umbraco.Infrastructure
  • Disabled CPM in Umbraco.Web.UI project and explicitly specified package versions
  • Cleaned up unused CodeAnalysis package references from Central Package Management

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj Removes Microsoft.CodeAnalysis.CSharp package reference
src/Umbraco.Web.UI/Umbraco.Web.UI.csproj Disables CPM and adds explicit version numbers for EF Core Design and ICU packages
Directory.Packages.props Removes unused CodeAnalysis package versions from central management

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Have tested a local build and run of Umbraco and don't see any issues.

@lauraneto lauraneto merged commit b5662d9 into v17/dev Oct 14, 2025
25 checks passed
@lauraneto lauraneto deleted the v17/bugfix/remove-codeanalysis-dependency-from-infrastructure branch October 14, 2025 07:39
lauraneto added a commit that referenced this pull request Oct 14, 2025
…Umbraco.Infrastructure (#20481)

* Remove Microsoft.CodeAnalysis.CSharp from Infrastructure project

This was only needed for runtime compilation and thus is no longer needed in Infrastructure.
It also caused dependency problems with EF Core Design in previous versions.

* Disable CPM for UI project to better reflect consumers

This will ensure that we face any potential dependency issues consumers are also likely to run into.

* Add `Microsoft.CodeAnalysis.CSharp` reference to `Umbraco.Cms.DevelopmentMode.Backoffice`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend dependencies Pull requests that update a dependency file release/17.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants