Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- [CLI] Reference the compiled output of referenced projects that cannot be loaded into the workspace (for example F# projects), so their types are no longer reported as missing (`CS0103`/`CS0246`) during analysis ([PR](https://github.com/dotnet/roslynator/pull/1833))

## [5.0.0] - 2026-08-21

### Added
Expand Down
10 changes: 9 additions & 1 deletion src/CommandLine/Commands/MSBuildWorkspaceCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,15 @@ private static MSBuildWorkspace CreateMSBuildWorkspace(string msbuildPath, IEnum
if (!properties.ContainsKey("AlwaysCompileMarkupFilesInSeparateDomain"))
properties["AlwaysCompileMarkupFilesInSeparateDomain"] = bool.FalseString;

return MSBuildWorkspace.Create(properties);
MSBuildWorkspace workspace = MSBuildWorkspace.Create(properties);

// Fall back to a referenced project's compiled output when the project itself cannot be
// loaded into the workspace (for example an F# project, which MSBuildWorkspace does not
// support). Without this, types defined in such a project are invisible to the C#/VB
// projects that reference it and surface as false CS0246/CS0103 errors during analysis.
workspace.LoadMetadataForReferencedProjects = true;

return workspace;
}

private static bool TryGetVisualStudioInstance(out VisualStudioInstance result)
Expand Down
Loading