Skip to content

SharedResources on ASP.NET Core 3.0 Project not working after updating Visual Studio to v16.4.0 #16083

Closed
@pocki

Description

@pocki

Since updating Visual Studio to v16.4.0 the SharedResources Keys are not found anymore in IHtmlLocalizer<SharedResource> my ASP.NET Core 3.0 MVC WebApp. When the ASP.NET Core 3.0 App gets compiled with Azure Pipeline Hostest Windows-2019 Agent (actual running Visual Studio v16.9.x) it is running and working as expected.

I use CookieRequestCultureProvider, and Cookies are set und read correctly.

What I tried after Visual Studio Update without success:

  • Reinstall .NET Core SDK v3.0.101 (which gets uninstalled at Visual Studio update)
  • Create global.json with:
{
  "sdk": {
    "version": "3.0.100"
  }
}
  • Clean and Rebuild multiple times, manually deleting /bin and /obj folders
  • Cleared cookies and Browser Caches
  • Restarting Windows and restarting Visual Studio multiple times

Expected Behavior:
SharedResource Keys are found with IHtmlLocalizer<SharedResource> and localization is used. It also works with Azure Pipeline and Hosted Agent Windows-2019 Image

Actual Behavior:
SharedResource Keys are not found with IHtmlLocalizer<SharedResource>

@inject IHtmlLocalizer<SharedResource> Localizer
Localizer["ExistingResourceKey"].IsResourceNotFound // is true

Version Used:
OS: Windows Server 2016 x64 (all Updates installed)

dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.100
Commit: cd82f021f4

Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.100\

Host (useful for support):
Version: 3.1.0
Commit: 65f04fb6db

.NET Core SDKs installed:
2.1.509 [C:\Program Files\dotnet\sdk]
3.0.101 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Microsoft Visual Studio Enterprise 2019
Version 16.4.0
VisualStudio.16.Release/16.4.0+29519.181
Microsoft .NET Framework
Version 4.8.03761


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions