Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document BuildWithNetFrameworkHostedCompiler and friends #45620

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jjonescz
Copy link
Member

@jjonescz jjonescz commented Apr 3, 2025

Documents the pre-existing property BuildWithNetFrameworkHostedCompiler and two related properties that are being added in dotnet/sdk#48028.


Internal previews

📄 File 🔗 Preview link
docs/core/project-sdk/msbuild-props.md docs/core/project-sdk/msbuild-props

Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

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

Thanks @jjonescz

When using .NET Framework MSBuild, `BuildWithNetFrameworkHostedCompiler=true` ensures that
a C#/VB compiler corresponding to the current SDK version is used
instead of the default version that ships with MSBuild.
This uses the .NET Framework version of the compiler unlike `RoslynUseSdkCompiler`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This uses the .NET Framework version of the compiler unlike `RoslynUseSdkCompiler`.
When this property is set to `true`, the .NET Framework version of the compiler is used, unlike `RoslynUseSdkCompiler`.

a C#/VB compiler corresponding to the current SDK version is used
instead of the default version that ships with MSBuild.
This uses the .NET Framework version of the compiler unlike `RoslynUseSdkCompiler`.
In some cases, this happens automatically when it is detected that MSBuild and SDK versions are different,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In some cases, this happens automatically when it is detected that MSBuild and SDK versions are different,
In some cases, this behavior happens automatically when it is detected that MSBuild and SDK versions are different,

instead of the default version that ships with MSBuild.
This uses the .NET Framework version of the compiler unlike `RoslynUseSdkCompiler`.
In some cases, this happens automatically when it is detected that MSBuild and SDK versions are different,
and then `BuildWithNetFrameworkHostedCompiler=false` can be used to opt out of this behavior.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
and then `BuildWithNetFrameworkHostedCompiler=false` can be used to opt out of this behavior.
and then you can set `BuildWithNetFrameworkHostedCompiler=false` to opt out of the behavior.

When using .NET Framework MSBuild, `RoslynUseSdkCompiler=true` ensures that
a C#/VB compiler corresponding to the current SDK version is used
instead of the default version that ships with MSBuild.
This uses the .NET Core version of the compiler unlike `BuildWithNetFrameworkHostedCompiler`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
This uses the .NET Core version of the compiler unlike `BuildWithNetFrameworkHostedCompiler`.
When this property is set to `true`, the .NET Core version of the compiler is used, unlike `BuildWithNetFrameworkHostedCompiler`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants