Skip to content

[dotnet-sdk-9.0.100-preview.7.24379.15] Fail to build CleanArchitecture2 app with an error "CS0619:'MudMenu.OffsetY' is obsolete: 'Use AnchorOrigin or TransformOrigin instead.'" #42509

Closed
@Junjun-zhao

Description

@Junjun-zhao

Application Name: CleanArchitecture2
OS: Windows 10 21H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-preview.7.24379.15
App Source checking at: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2183568
Github Link:
https://github.com/blazorhero/CleanArchitecture

Verify Scenarios:
1). Windows 10 21H2 AMD64 + dotnet-sdk-6.0.424:Pass
2). Windows 10 21H2 AMD64 +dotnet-sdk-9.0.100-preview.6.24328.19: Pass
3). Windows 10 21H2 AMD64 +dotnet-sdk-9.0.100-preview.7.24379.15: Fail

Description :
When build the 3rd party application with the latest .NET 9 build "dotnet-sdk-9.0.100-preview.7.24379.15", it throws obsolete exception such as
"error CS0619: 'MudMenu.OffsetX' is obsolete: 'Use AnchorOrigin or TransformOrigin instead". After investigation, we found it is related to the MudBlazor Nuget package(Version : 6.0.2).

This does not reproduce on dotnet-sdk-9.0.100-preview.6.24328.19. Could you help confirm whether this is expected? If Yes, is this a breaking change?

Findings:
The CS0619 error will be gone after upgrade the MudBlazor nuget package from V6.0.2 to the latest V7.5.0.

Minimal Repro Steps:
The machine has dotnet-sdk-9.0.100-preview.7.24379.15 installed

  1. Create Blazor Server app with .NET 6.0
  2. Install MudBlazor nuget package (Version : 6.0.2)
  3. Add the following to _Imports.razor
    @using MudBlazor
  4. Add the following to _Host.cshtml
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />

  1. Add the following to MainLayout.razor
@inherits LayoutComponentBase
<PageTitle>BlazorAppDemo</PageTitle>
<MudAppBar Elevation="25">
    <MudMenu Direction="Direction.Left" OffsetX="true" OffsetY="true" Dense="true" Class="mt-1 ml-4"></MudMenu>
</MudAppBar>

  1. Build app with 9.0.100-preview.7.24379.15 SDK

Expected Result:
App build successfully.

Actual Result:
App build with error:

D:\ReproBugDeMO\BlazorAppDemo\BlazorAppDemo\obj\Debug\net6.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Shared_MainLayout_razor.g.cs(114,51): error CS0619: 'MudMenu.Direction' is obsolete: 'Use AnchorOrigin or TransformOrigin instead.'    D:\ReproBugDeMO\BlazorAppDemo\BlazorAppDemo\obj\Debug\net6.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Shared_MainLayout_razor.g.cs(131,51): error CS0619: 'MudMenu.OffsetX' is obsolete: 'Use AnchorOrigin or TransformOrigin instead.'    D:\ReproBugDeMO\BlazorAppDemo\BlazorAppDemo\obj\Debug\net6.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Shared_MainLayout_razor.g.cs(148,52): error CS0619: 'MudMenu.OffsetY' is obsolete: 'Use AnchorOrigin or TransformOrigin instead.'

App Repro steps:
The machine has dotnet-sdk-9.0.100-preview.7.24379.15 installed.

  1. Copy the source code to your locally machine.
  2. cd to CleanArchitecture2\src\Server folder.
  3. Build app with 9.0.100-preview.7.24379.15 SDK

Expected Result:
App build successfully.

Actual Result:
Fail to build the app with error:

D:\CleanArchitecture2\src\Client\obj\Debug\net6.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Shared_MainBody_razor.g.cs(719,56): error CS0619: 'MudMenu.OffsetY' is obsolete: 'Use AnchorOrigin or TransformOrigin instead.'
D:\CleanArchitecture2\src\Client\obj\Debug\net6.0\Microsoft.CodeAnalysis.Razor.Compiler\Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator\Shared_MainBody_razor.g.cs(1657,53): error CS0619: 'MudMenu.OffsetX' is obsolete: 'Use AnchorOrigin or TransformOrigin instead.'

Dotnet Info:

.NET SDK:
 Version:           9.0.100-preview.7.24379.15
 Commit:            812e813ae9
 Workload version:  9.0.100-manifests.28aae763
 MSBuild version:   17.12.0-preview-24374-02+48e81c6f1

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\9.0.100-preview.7.24379.15\

Host:
  Version:      9.0.0-preview.7.24376.15
  Architecture: x64
  Commit:       static

.NET SDKs installed:
  9.0.100-preview.7.24379.15 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 9.0.0-preview.7.24379.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 9.0.0-preview.7.24376.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 9.0.0-preview.7.24379.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

@dotnet-actwx-bot @dotnet/compat

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-AspNetCoreRazorSDK, BlazorWebAssemblySDK, dotnet-watchuntriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions