리소스를 사용하여 MVC 응용 프로그램에서 지역화를 위해 다른 문자열을 저장합니다. JavaScript를 처리하고 리소스의 실제 지역화 된 문자열 값으로 Translate(KEY)
호출을 변경하기 위해 HttpHandler를 사용하고 있습니다. 이 여기에 대한 제공 : Localize text in JavaScript files in ASP.NETgetobject()를 사용하여 MissingManifestResourceException을 던졌습니다.
문제는 내가 내 자원 관리자로부터으로 getObject 메소드를 호출 할 때 내가 여기
MissingManifestResourceException Could not find any resources appropriate for the specified culture or the neutral culture.
는 관련 코드 부분 (오류가 아래의 코드에서 6 호선에서 유래)가 얻을 수 있습니다 :
private string TranslateScript(string text)
{
MatchCollection matches = REGEX.Matches(text);
ResourceManager manager = new ResourceManager(typeof(CamelotShiftManagement.Strings.SharedStrings));
foreach (Match match in matches)
{
object obj = manager.GetObject(match.Groups[1].Value, CultureInfo.CurrentCulture); //This throws the MissingManifestResourceException for some reson!!!!
if (obj != null)
{
text = text.Replace(match.Value, CleanText(obj.ToString()));
}
}
return text;
}
내가 뭘 잘못하고 있니?