Skip to content

MvcBuildViews fails with a cryptic MSB4803 under the dotnet CLI (AspNetCompiler is unavailable) #107

Description

@ehasis

Split out from #103 (item 3).

Summary

In Release the SDK sets MvcBuildViews=true and runs the AspNetCompiler task in the MvcBuildViews target. That task ships only with the full .NET Framework MSBuild, so under dotnet (Core MSBuild) the build fails with:

error MSB4803: The task "AspNetCompiler" is not supported on the .NET Core version of MSBuild.

Proposed change

Under Core MSBuild, replace the cryptic MSB4803 with a clear, actionable message (e.g. SYSWEB002) that explains AspNetCompiler is unavailable on the .NET Core MSBuild used by dotnet, and that the step can be skipped intentionally by setting:

<!-- e.g. in Directory.Build.props -->
<MvcBuildViews Condition="'$(MSBuildRuntimeType)' == 'Core'">false</MvcBuildViews>

Skipping stays opt-in (the user's explicit choice); precompiling views with the full Visual Studio MSBuild is unchanged.

(Open to either: a hard error with the guidance above, or a non-fatal message + skip behind an opt-in property — whichever you prefer.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions