Describe the bug
ERROR CS0234: The type or namespace name 'ApplicationPartAttribute' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.ApplicationParts' (are you missing an assembly reference?)
The above error is being thrown on the Blazor client project when a reference to Microsoft.AspNetCore.Mvc.DataAnnotations.dll exists on the shared project.
To Reproduce
- Create a Blazor Web Assembly project
- On the shared project, add a depedency on the latest
Microsoft.AspNetCore.Mvc.DataAnnotations.dll
- Create a POCO with a property that has the
[HiddenInput]attribute in the shared project
- Build the project
Further technical details
.NET SDK (reflecting any global.json):
Version: 5.0.100-rc.2.20479.15
Commit: da7dfa8840
Runtime Environment:
OS Name: Windows
OS Version: 10.0.20221
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-rc.2.20479.15\
Host (useful for support):
Version: 5.0.0-rc.2.20475.5
Commit: c5a3f49c88
.NET SDKs installed:
5.0.100-rc.2.20479.15 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0-rc.2.20475.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0-rc.2.20475.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.0-rc.2.20475.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
- The IDE: Microsoft Visual Studio Community 2019 Preview Version 16.8.0 Preview 6.0
Describe the bug
ERROR CS0234: The type or namespace name '
ApplicationPartAttribute' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.ApplicationParts' (are you missing an assembly reference?)The above error is being thrown on the Blazor client project when a reference to
Microsoft.AspNetCore.Mvc.DataAnnotations.dllexists on the shared project.To Reproduce
Microsoft.AspNetCore.Mvc.DataAnnotations.dll[HiddenInput]attribute in the shared projectFurther technical details
dotnet --info: