Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6202167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:41:08+00:00 2026-05-24T04:41:08+00:00

So I’m trying to use both local and global resources in a simple Net

  • 0

So I’m trying to use both local and global resources in a simple Net 3.5 / Mvc2 site.

First of all I tried setting my validation messages in global resources but then the first problem arose: setting the global resource on the DataAnnotations attribute gives no errors, but at runtime it just doesn’t recover the strings from it (no errors at runtime either). Sample code:

[Required(
        ErrorMessageResourceType = typeof(Resources.Global),
        ErrorMessageResourceName = "LastNameRequired")]
    public string LastName { get; set; }

Global resources cannot be set to public (I think that’s the problem) so I thought to move messages to be used in DataAnnotations in local resources:

[Required(
        ErrorMessageResourceType = typeof(Views.MyApp.App_LocalResources.Apply_aspx),
        ErrorMessageResourceName = "LastNameRequired")]
    public string LastName { get; set; }

That brought me to 2 alternate problems: if I set the local resource to build action = content the resources are read correctly from the view using the GetLocalResourceObject method, but I get the following when trying to read them from DataAnnotations:

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure “MyNamespace.Website.Mvc.Views.MyApp.App_LocalResources.Apply.aspx.resources” was correctly embedded or linked into assembly “MyNamespace.Website.Mvc” at compile time, or that all the satellite assemblies required are loadable and fully signed.

Then I tried to set the the build action = embedded resource. This way the App_LocalResources folder doesn’t get published, and I get the following error when trying to read local resources from the view with GetLocalResouceObject:

The resource class for this page was not found. Please check if the resource file exists and try again.

I obviously tried to google around for a solution but I couldn’t find anything that resembles my scenario, so I’m asking here.

What do I have to do to make evertything smooth?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:41:09+00:00Added an answer on May 24, 2026 at 4:41 am

    I found a way by myself digging further.

    I was trying to use the “LocalResources” declared in the Views folder from the code. That was the problem.

    The right course of action is using those resources files only for the views. Then, for the code, declared a App_LocalResources folder at root level, and put resources files there, setting them to public.

    That worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.