Skip to content

[Breaking change]: MSBuild FileAccess types are now internal #37642

@rainersigwald

Description

@rainersigwald

Description

New APIs introduced to MSBuild in dotnet/msbuild#9214 will be removed or made internal for the final release of MSBuild 17.8/.NET SDK 8.0.100.

Version

.NET 8 GA

Previous behavior

The type Microsoft.Build.Framework.FileAccess was available to use and EngineServices.ReportFileAccess was callable.

New behavior

The type is now Microsoft.Build.Experimental.FileAccess and may be changed or removed in a future MSBuild release.

EngineServices.ReportFileAccess(FileAccessData) is callable only through private reflection and may break in a future MSBuild release.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

Reason for change

FileAccessData is extremely detailed and Windows-specific. It's very difficult to create one correctly based on the .NET APIs you are using, so we expect to expose a better API in a future release.

Recommended action

Delay implementation of a cache plugin until an improved API is delivered, or use private reflection to call EngineServices.ReportFileAccess(Microsoft.Build.Experimental.FileAccess) until they are available. If you choose private reflection, you will be broken by a future release.

Feature area

SDK

Affected APIs

These are removed:

struct Microsoft.Build.Framework.FileAccess

Microsoft.Build.Framework.EngineServices.ReportFileAccess(Microsoft.Build.Framework.FileAccess)


Associated WorkItem - 177285

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 8Work items for the .NET 8 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.binary incompatibleExisting binaries may encounter a breaking change in behavior.breaking-changeIndicates a .NET Core breaking changesource incompatibleSource code may encounter a breaking change in behavior when targeting the new version.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions