'The type or namespace name 'Resource File' does not exist in the namespace 'Resources' after deploying the Asp.Net app in Docker Kubernetes

I have an ASP.NET Webforms application. It has been working without any issues for years. Now I am trying to deploy the app in Docker Kubernetes. It is deployed successfully without any compilation errors. But when I access one page it's throwing this exception:

System.Web.HttpCompileException (0x80004005): c:\inetpub\wwwroot\Client\User\MyPage.aspx.cs(179): error CS0234: The type or namespace name 'Messages' does not exist in the namespace 'Resources' (are you missing an assembly reference?) at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFoun d, Boolean ensureIsUpToDate)

Resource file Messages.resx is added in the App_GlobalResources folder and it's being copied under the root folder of the app as guided in the official documentation.

I have tried to recreate the resource also, but it also didn't work.

Below is the Messages class

#region Assembly App_GlobalResources.tlvvgtfn, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// C:\Users\Vivek.Nuna\AppData\Local\Temp\Temporary ASP.NET Files\root\dfad19b2\_shadow\477aa3de\26952\App_GlobalResources.tlvvgtfn.dll
#endregion

using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Resources;
using System.Runtime.CompilerServices;

namespace Resources
{
    [CompilerGenerated]
    [DebuggerNonUserCode]
    [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    public class Messages
    {


Solution 1:[1]

I have solved the issues. It copied to resource files with all lower cases in the file name. So I have made the changes in my Dockerfile to copy the file with the same cases in file names and it worked like magic.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 vivek nuna