Closed tommiller85 closed 12 years ago
What was the resolution?
I get the same with latest version:
NullReferenceException: Object reference not set to an instance of an object.]
Griffin.MvcContrib.SqlServer.Localization.SqlLocalizedTypesRepository.GetPrompt(CultureInfo culture, TypePromptKey key) in D:\Tfs\External\griffin.mvccontrib\griffin.mvccontrib\source\Griffin.MvcContrib.SqlServer\Localization\SqlLocalizedTypesRepository.cs:106
Griffin.MvcContrib.Localization.Types.RepositoryStringProvider.Translate(Type type, String name) +357
Griffin.MvcContrib.Localization.Types.RepositoryStringProvider.GetModelString(Type model, String propertyName) +42
Griffin.MvcContrib.Localization.LocalizedModelMetadataProvider.Translate(Type type, String propertyName) +52
Griffin.MvcContrib.Localization.LocalizedModelMetadataProvider.CreateMetadata(IEnumerable1 attributes, Type containerType, Func
1 modelAccessor, Type modelType, String propertyName) +143
System.Web.Mvc.AssociatedMetadataProvider.GetMetadataForProperty(Func1 modelAccessor, Type containerType, PropertyDescriptor propertyDescriptor) +93 System.Web.Mvc.<GetMetadataForPropertiesImpl>d__2.MoveNext() +226 System.Linq.Buffer
1..ctor(IEnumerable1 source) +217 System.Linq.<GetEnumerator>d__0.MoveNext() +96 System.Linq.WhereSelectEnumerableIterator
2.MoveNext() +87
System.Collections.Generic.List1..ctor(IEnumerable
1 collection) +327
System.Linq.Enumerable.ToList(IEnumerable1 source) +58 Kendo.Mvc.UI.ModelDescriptor.Translate(ModelMetadata metadata) +143 Kendo.Mvc.UI.ModelDescriptor..ctor(Type modelType) +123 Kendo.Mvc.UI.DataSource.ModelType(Type modelType) +62 Kendo.Mvc.UI.Grid
1..ctor(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator, ILocalizationService localizationService, IGridHtmlBuilderFactory htmlBuilderFactory) +1504
Kendo.Mvc.UI.ViewComponentFactory.Grid() +245
Kendo.Mvc.UI.ViewComponentFactory.Grid(IEnumerable1 dataSource) +95 ASP._Page_Areas_razor_Views_web_grid_index_cshtml.Execute() in c:\Users\djones.INTEGRATION\Documents\Visual Studio 2010\Projects\Peer2Peer\Areas\razor\Views\web\grid\index.cshtml:13 System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207 System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81 System.Web.WebPages.StartPage.RunPage() +19 System.Web.WebPages.StartPage.ExecutePageHierarchy() +65 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +76 System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303 System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13 System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func
1 continuation) +260
System.Web.Mvc.<>cDisplayClass1e.1 continuation) +260 System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList
1 filters, ActionResult actionResult) +177
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
System.Web.Mvc.Controller.ExecuteCore() +116
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
System.Web.Mvc.<>cDisplayClassb.
Yeah, I can reproduce it but can't figure out why.
Jonas,
While I have copied your application start - with a few neccesary chages i.e database name to my global.asax and followed all other steps as laid out I receive this error.
Failed to find an 'ILocalizedStringProvider' implementation. Either include one in the LocalizedModelMetadataProvider constructor, or register an implementation in your Inversion Of Control container.
Any help greatly appreciated.
On Tue, Aug 14, 2012 at 3:24 AM, Jonas Gauffin notifications@github.comwrote:
Yeah, I can reproduce it but can't figure out why.
— Reply to this email directly or view it on GitHubhttps://github.com/jgauffin/griffin.mvccontrib/issues/6#issuecomment-7721925.
Hi Jonas,
I am experiencing the same issue with @eSaw (see above) Also the last line of the code segment I placed in Application_start had to change as: ModelValidatorProviders.Providers.Add(new LocalizedModelValidatorProvider());
Thank you for your contributions,
Have you tried with the lastest packages?
Closed due to lack of response
I get the following problem when trying to use the System.Web.Mvc.Compare attribute on my model.
Object reference not set to an instance of an object.
Call stack location:
Griffin.MvcContrib.DLL!Griffin.MvcContrib.Localization.LocalizationModelValidatorProvider.MyValidator.Validate() Line 194 + 0x35 bytes
Source file information:
Locating source for 'D:\Tfs\External\griffin.mvccontrib\griffin.mvccontrib\source\Griffin.MvcContrib\Localization\LocalizedModelValidatorProvider.cs'. Checksum: MD5 {a4 85 85 22 c3 89 75 c4 a7 85 35 77 1e a4 29 1f} The file 'D:\Tfs\External\griffin.mvccontrib\griffin.mvccontrib\source\Griffin.MvcContrib\Localization\LocalizedModelValidatorProvider.cs' does not exist. Looking in script documents for 'D:\Tfs\External\griffin.mvccontrib\griffin.mvccontrib\source\Griffin.MvcContrib\Localization\LocalizedModelValidatorProvider.cs'... Looking in the projects for 'D:\Tfs\External\griffin.mvccontrib\griffin.mvccontrib\source\Griffin.MvcContrib\Localization\LocalizedModelValidatorProvider.cs'. The file was not found in a project. Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'... Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'... The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: D:\Tfs\External\griffin.mvccontrib\griffin.mvccontrib\source\Griffin.MvcContrib\Localization\LocalizedModelValidatorProvider.cs. The debugger could not locate the source file 'D:\Tfs\External\griffin.mvccontrib\griffin.mvccontrib\source\Griffin.MvcContrib\Localization\LocalizedModelValidatorProvider.cs'.