Getting a System.NullReferenceException error after updating to v 1.7

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 anos atrás
Hi, I have updated to v 1.7 and now when I click on some of the products I get this error:

System.NullReferenceException: Object reference not set to an instance of an object.

<%#Server.HtmlEncode(Eval("LocalizedName").ToString())%>

How do I resolve this?

Thank you.
13 anos atrás
Please go to Admin Area > System > Log and copy a complete error message here
13 anos atrás
Here it is:

Log type:      Unknown
t Severity:   11
t Message:   Exception of type 'System.Web.HttpUnhandledException' was thrown.
t Exception:   System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at ASP.modules_productvariantsingrid_ascx.__DataBind__control4(Object sender, EventArgs e) in c:\HostingSpaces\jewro\justkosherfood.keytoweb.net\wwwroot\Modules\ProductVariantsInGrid.ascx:line 20 at System.Web.UI.Control.OnDataBinding(EventArgs e) at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at System.Web.UI.Control.DataBindChildren() at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) at System.Web.UI.Control.DataBind() at System.Web.UI.WebControls.Repeater.CreateItem(Int32 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) at System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) at System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) at System.Web.UI.WebControls.Repeater.DataBind() at NopSolutions.NopCommerce.Web.Modules.ProductVariantsInGridControl.BindData() in F:\etc\nopCommerce_1.70_Source\NopCommerceStore\Modules\ProductVariantsInGrid.ascx.cs:line 58 at NopSolutions.NopCommerce.Web.Modules.ProductVariantsInGridControl.Page_Load(Object sender, EventArgs e) in F:\etc\nopCommerce_1.70_Source\NopCommerceStore\Modules\ProductVariantsInGrid.ascx.cs:line 46 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.product_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f4379171\de8283e4\App_Web_am5ykfrc.37.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
13 anos atrás
It'll require some debugging
1. Open NopSolutions.NopCommerce.BusinessLogic.Products.ProductVariant class
2. Set breakpoint into get accessor of LocalizedName property
3. See why NullReferenceException is thrown
13 anos atrás
But I don't have the business logic folder on the server. I have the nopcommerceStore folder with all the subfolders and it's files. Please advice.
13 anos atrás
And if I have to work on it from my local computer and then recompile everything...
I set the breakpoint at the place mentioned and when I run it I get the error:
Error  1  
Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'.  
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config  129  

That's the line in web.config:
<add extension=".edmx" type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />

How to resolve it?

Thank you.
13 anos atrás
Alpinhasov wrote:
But I don't have the business logic folder on the server. I have the nopcommerceStore folder with all the subfolders and it's files. Please advice.

You need full source code version in order to debug it
13 anos atrás
Alpinhasov wrote:
Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'.  
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config  129

http://forums.asp.net/t/1546705.aspx
http://forums.silverlight.net/forums/p/176086/397038.aspx
13 anos atrás
I figured that out...the web.config error is from my local machine. Any advice on why the error happens?
13 anos atrás
Alpinhasov wrote:
I figured that out...the web.config error is from my local machine. Any advice on why the error happens?

No idea. Try the links I provided above
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.