newly added property not found.

1 2 >
Posted: August 29, 2013 at 12:26 AM Quote #104161
Hello,

I have added new property name "range" in searchBoxModel. I start my application then no bug comes but  when i restart again then, following error comes.
[MissingMethodException: Method not found: 'System.String Nop.Web.Models.Catalog.SearchBoxModel.get_Range()'].


SearchBoxModel code
public string Name { get; set; }
public int Range { get; set; }

SeachBox.cshtml code
@Html.HiddenFor(model => model.Name)
@Html.HiddenFor(model => model.Range)

when i access only 'Name' in view then error never comes but whenever i try to access 'Range' in view then, error comes.
Version: nopCommerce 2.8

Please help...


Thanks in advanced.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 08, 2013 at 7:25 AM Quote #106691
Any answer to this problem? I'm having the same issue. I added a new property in HeaderLinksModel.cs first try viewing the page works fine but when I closed the browser and do it again without cleaning/building the entire projects the problem will show up.

I'm using nopCommerce 3.00
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 10, 2013 at 5:12 AM Quote #106812
Any answer on this one? I still haven't find the solution to this problem. Even in the live server I'm having this problem. Thanks!
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 14, 2013 at 3:22 PM Quote #107004
Bump... Still having the same issue. Tried different solution by providing CustomProperties with new Dictionary, first debug session it went through but the second time it didn't pass through in HeaderLinks() action method! I guess I'm having the same issue.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 22, 2013 at 1:45 PM Quote #107520
Hi,

We have the Same Issue in NOP 3.0.
We have an New Property of type Dictionary and it works
after first deployment. After a while (we think cache will expire)
We receive also the Method not found exception.

Have you found any solutions.

Thanks

José
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 22, 2013 at 2:24 PM Quote #107522
If it works at first and then after a while it doesn't, check to make sure you don't have any Nop.Core/Data/Services DLLs in your Plugins folder.  If it's an old version then the AppPool will reboot eventually and it loads those instead of the correct ones.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
StackOverflow - http://stackoverflow.com/users/113988/andymckenna
http://bitshiftweb.com - FirstData and Payeezy payment plugin and contract development services
Posted: October 22, 2013 at 2:53 PM Quote #107527
Hi,

Thnkas for your Feedback.
I doubled checked it.
We don't have any NOP... DLL's in other directories.

We are now trying to clear the assemlby cache
at the time te app pool reclycler runs.

I will post our experienses soon..

Regards
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 22, 2013 at 3:05 PM Quote #107528
Hello We could find a Solution:

The reason seems to be ASP.Net and the way it loads assemblies from your application directory for the first time and after a recycle. On first start, the assemblies are loaded from your application's bin directory and after a recycle (or even an IIS restart) it loads the assemblies from the Temporary ASP.NET Files directory. And depending on the situation more or less assemblies are loaded.

Her our Workaround (Not Nice but Works)
We load a new DLL in PreInitialize this will reload the Assemblies after Recygling:

Add a PreInitialize Entry in AssembliInfo.cs

[assembly: PreApplicationStartMethod(typeof(Nop.Web.Initializer), "BreakCache")]


Add a new Class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;
using System.Web;
using System.Web.Compilation;

namespace Nop.Web
{
    public static class Initializer
    {
        public static void BreakCache()
        {
            // start the assembly
            string tempFolder = System.Threading.Thread.GetDomain().BaseDirectory;
            var assemblyName = new AssemblyName { Name = "Cachebuster_" + DateTime.Now.ToString("yyyyMMddhhmmssfff") };
            var filename = assemblyName.Name + ".dll";
            var fullpath = tempFolder + @"\Plugins\" + filename;

            // create our builders
            var asmBuilder = Thread.GetDomain()
                  .DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.RunAndSave, tempFolder + @"\Plugins\");
            var fakeModule = asmBuilder
                  .DefineDynamicModule(assemblyName.Name, filename, true);
            var typeBuilder = fakeModule
                  .DefineType(string.Format("WhoYaGonnaCall{0}", DateTime.Now.ToString("fff")), TypeAttributes.Public);
            var fakeMethod = typeBuilder
                  .DefineMethod("Cachebusters", MethodAttributes.Public | MethodAttributes.Static);

            // emit a minimum amount of IL
            var methodIL = fakeMethod.GetILGenerator();
            methodIL.Emit(OpCodes.Ret);

            // create the type and save the DLL
            typeBuilder.CreateType();
            asmBuilder.Save(filename);

            var assembly = Assembly.LoadFile(fullpath);

            BuildManager.AddReferencedAssembly(assembly);
            BuildManager.AddCompilationDependency(assembly.FullName);
        }
    }
}

Hope it helps for others that need a quick fix.

Regards

José
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: October 22, 2013 at 8:34 PM Quote #107543
What we did in the live server not in my local IIS express is we set the recycling pool to 30 days to check if it's reverting back to the first old installation nop.web.dll, now the server is running fine but we still have to find a better solution for this one.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: November 14, 2013 at 10:16 AM Quote #109076
Please check if you have a circular dependency with your plugins and nop.web. I guess this solves our problem.
This post/answer is useful
1
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
1 2 >
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2017
Learn more