2

我的 MVC3 Web 应用程序有问题。我收到一个 RuntimeBinderException。

我的动态页面元标记有问题。元标记是从 .resx 文件中设置的。我认为它无法在运行时访问资源。而且其他国家的人也无法访问该网站。存在连接超时错误。但是我们在美国,我们可以访问该网站。你有什么主意吗?

我的元标记在下面;

public ActionResult Index()
    {
        ViewBag.Description = Glob.HomeDescription;
        ViewBag.Keywords = Glob.HomeKeywords; ;
        ViewBag.Title = Glob.HomeTitle;

        var data = new HomeData();
        data.AnnouncementLists = _announcementService.GetAnnouncementList(LanguageId).Data;
        data.FeedBackLists = _feedbackService.GetFeedbackListHome(LanguageId).Data;
        data.Newfeedback = new FeedBackDTO { Context = "", Id = Guid.NewGuid(), Date = DateTime.Now, FeedBackId = Guid.NewGuid(), LanguageId = LanguageId, Status = false, LanguageName = "", Who = "" };
        return View(data);
    }

错误如下;

Exception Type: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException

Message: 'System.Dynamic.DynamicObject' does not contain a definition for 'Description'

Stack Trace: at Microsoft.CSharp.RuntimeBinder.RuntimeBinderController.SubmitError(CError pError) at Microsoft.CSharp.RuntimeBinder.Semantics.LangCompiler.SubmitError(CParameterizedError error) at Microsoft.CSharp.RuntimeBinder.Semantics.MemberLookup.ReportErrors() at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindProperty(DynamicMetaObjectBinder payload, ArgumentObject argument, LocalVariableSymbol local, EXPR optionalIndexerArguments, Boolean fEventsPermitted) at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindAssignment(DynamicMetaObjectBinder payload, ArgumentObject[] arguments, Dictionary`2 dictionary) at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.DispatchPayload(DynamicMetaObjectBinder payload, ArgumentObject[] arguments, Dictionary`2 dictionary) at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.BindCore(DynamicMetaObjectBinder payload, IEnumerable`1 parameters, DynamicMetaObject[] args, DynamicMetaObject& deferredBinding) at Microsoft.CSharp.RuntimeBinder.RuntimeBinder.Bind(DynamicMetaObjectBinder payload, IEnumerable`1 parameters, DynamicMetaObject[] args, DynamicMetaObject& deferredBinding) at Microsoft.CSharp.RuntimeBinder.BinderHelper.Bind(DynamicMetaObjectBinder action, RuntimeBinder binder, IEnumerable`1 args, IEnumerable`1 arginfos, DynamicMetaObject onBindingError)**strong text**

任何意见将是有益的。谢谢。

4

0 回答 0