Hi Guys

I have asp.net 4.0 application that is running perfect on my local iis server, but when i host it on web server, it is throwing me this error,

Parser Error Message: Theme 'Blue' cannot be found in the application or global theme directories.

how can i sort out this issue ?

thanks
regards
sumith

Dani AI

Generated

Below are targeted checks and quick diagnostics to add to the troubleshooting already suggested by . These focus on deployment, hosting and runtime behaviors that commonly cause the parser error even when the files look correct on the server.

A quick runtime check (drops a small list of deployed theme folder names on the page):

protected void Page_Load(object sender, EventArgs e)
{
    string themesPath = Server.MapPath("~/App_Themes");
    if (Directory.Exists(themesPath))
    {
        var names = Directory.GetDirectories(themesPath).Select(Path.GetFileName);
        Response.Write("Themes found: " + string.Join(", ", names));
    }
    else
    {
        Response.Write("App_Themes not present at: " + themesPath);
    }
}

If the site sets the theme dynamically, avoid putting a static Theme attribute in the .aspx/web.config (that causes parse-time validation). Set the theme in PreInit instead:

protected void Page_PreInit(object sender, EventArgs e)
{
    string theme = GetThemeFromConfigOrDb(); // your logic
    if (!string.IsNullOrEmpty(theme))
        Page.Theme = theme;
}

Additional checks not mentioned above:

  • Confirm the theme folder and its files are actually included in the Visual Studio publish output (folder must be part of the project and marked as Content). Publish profiles can exclude folders by mistake.
  • If using a publish package option that cleans the destination, make sure the theme wasn’t removed during deploy.
  • Hosting on non-Windows (Mono, Linux) makes file names case-sensitive — verify exact name matching.
  • File/ACLs: the app pool identity must have read access to the theme files.
  • Rare causes: trailing whitespace or hidden characters in the folder name (rename locally and re-upload to be safe).

For deeper debugging, enable temporary detailed ASP.NET errors or capture the full parser stack trace and the exact publish method/host IIS version — those details are usually required when the theme folder appears present but the parser still fails.

Recommended Answers

All 3 Replies

Did you make sure that you copied all of your files to the webserver?

Hi

Yes i have uploaded all the directories which contains my web site

thanks
regards
sumith

Verify that you have a sub directory named "Blue" and the necessary files in the App_Themes directory.

Also, If you are running this website from a sub directory in the wwwroot, check that the folder is set as "Application".

In IIS find the folder where the website resides, right click, properties and check that the Create Application button is disabled. If not click it to set the website as application.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.