TeaCommerce.Data.OrderLineProperty.OrderLineProperty has some invalid arguments
This is an odd one, well it could be simple but right now i am stumped.
I have an WebshopEvents_OrderLineAdded(Order order, OrderLine orderLine) event which is being called, but not working. On further investigation and some tinkering with the debug it seems that I have conflicting information about the OrderLineProperty constructor.
To compile the code I have options of the following overloads (alias, value), (alias, value, serverSideOnly) and (alias, value, serverSideOnly, isReadOnly).
But as soon as an order line item is added to the basket and the code is "excited", errors are thrown complaining about the invalid arguments. I comment the line out and get the debugger to stop in the Event, open up the intermediate window and find that the contructor should be (string, string, int?) and using that i can add properties from the intermediate window.
I replaced the dlls I had with ones from 1.4.4.1 but no better.
It could be a non teacommerce problem, but I just don't understand why the signatures whilst compiling is different from running. :/
I don't think the code itself won't show anything more as the issue is a conflict between the method signature at compile time and runtime. :/ I'll try and take some screen shots of the error to give you a little more info a little later. The code is basically the same as in this question about vairant prices
I am now working with a unqiue item (explained here) so i have added the additional properties on the client call, then i can tinker server side.
So, hopefully this will give a little more clarity on the situation. Here is a screen shot of visual studio teling me the overloads for the method and for the purpose of the screen shot i have written three so you can see the ones it doesn't like underlined.
But then running the code and triggering the event it throws an error as it doesn't like the (string,string,bool) method :-/
INNEREXCEPTION:
System.MissingMethodException: Method not found: 'Void TeaCommerce.Data.OrderLineProperty..ctor(System.String, System.String, Boolean)'.
at WebShop.Intergration.NewOrderLine.WebshopEvents_OrderLineAdded(Order order, OrderLine orderLine)
at TeaCommerce.Data.Order.Save()
at TeaCommerce.Base.AddOrderLine(Order order, Int32 nodeId, Nullable`1 orderLineId, Decimal quantity, Boolean isUnique, Boolean overwriteQuantity, IDictionary`2 dynamicProperties)
at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Nullable`1 orderLineId, Decimal quantity, Boolean isUnique)
at TeaCommerce.Base.AddUniqueOrderLine(Int32 nodeId, Int64 orderLineId, Decimal quantity)]
So, I have commented out the call which is throwing the error, put a break point in and then had a look via the Immediate window...
new OrderLineProperty("customProperty", "value", false)
The best overloaded method match for 'TeaCommerce.Data.OrderLineProperty.OrderLineProperty(string, string, int?)' has some invalid arguments
but....what didn't compile now runs in the in the immediate window..
new OrderLineProperty("customProperty", "value", null)
{value}
base {TeaCommerce.Data.OrderProperty}: {value}
UmbracoLanguageId: 0
screen shot for your pleasure...
it's as if two different dlls are being used. A little confused.
Almost looks like you are running two different binaries. Have you double checked that the Umbraco site runs on the same dll's as your visual studio when you build your project.
I agree, it is exactly what it looks like and I have deleted all the references, then deleted the bin folder, re-added the references (the same ones to the different projects) and built.
I'll do it again. It's possible something didn't clear or something. I appreciate your thoughts though.
I am somehow back here and was trying to add a property in the c# event, but having the same things as explained previously. I knew i was having a feeling of de-ja-vu.
I think I previously got around it by passing in the new properties with the javascript and now doing anything in the event. That's not possible in what I need to do now.
So I have updated the dlls, - 2.1.3 looks like it's not going to be much help so i chose 1.4.4.5 which looks a little familier. I as there is no presentation dll in the zip, i seem to have issues with my tcbase javascript calls. What do i have to do to fix this? Should the dll be in the package? or should i have new references in the web.config?
1.4.4.1 - 23 November 2012BREAKING: Removed old Tea Commerce request module, which was not compatible with Umbraco 4.10.1. Tea Commerce now uses the built in Umbraco base. ONLY Umbraco 4.5 versions will be broken by this.
... so what should I do to fix? although I am using 4.7.1 :s
Have you upgraded your VS solution to build agains the Tea Commerce dll files that are used on the website? Those need to be the same. Be sure to check the path to the dll in VS so you know it is the right one.
What you are saying is making sense and I agree with everything you are saying Anders, and i am trying. but it's just not making sense. I'll keep looking.
TeaCommerce.Data.OrderLineProperty.OrderLineProperty has some invalid arguments
This is an odd one, well it could be simple but right now i am stumped.
I have an WebshopEvents_OrderLineAdded(Order order, OrderLine orderLine) event which is being called, but not working. On further investigation and some tinkering with the debug it seems that I have conflicting information about the OrderLineProperty constructor.
To compile the code I have options of the following overloads (alias, value), (alias, value, serverSideOnly) and (alias, value, serverSideOnly, isReadOnly).
But as soon as an order line item is added to the basket and the code is "excited", errors are thrown complaining about the invalid arguments. I comment the line out and get the debugger to stop in the Event, open up the intermediate window and find that the contructor should be (string, string, int?) and using that i can add properties from the intermediate window.
I replaced the dlls I had with ones from 1.4.4.1 but no better.
It could be a non teacommerce problem, but I just don't understand why the signatures whilst compiling is different from running. :/
Immediate window. not intermediate :)
Hi Peter,
Could you post some of your code? Sounds like a really weird problem, so the solutions might be quite simple.
/Rune
Hi Rune,
I don't think the code itself won't show anything more as the issue is a conflict between the method signature at compile time and runtime. :/ I'll try and take some screen shots of the error to give you a little more info a little later. The code is basically the same as in this question about vairant prices
I am now working with a unqiue item (explained here) so i have added the additional properties on the client call, then i can tinker server side.
P
Sorry about the delay, a busy week.
So, hopefully this will give a little more clarity on the situation. Here is a screen shot of visual studio teling me the overloads for the method and for the purpose of the screen shot i have written three so you can see the ones it doesn't like underlined.
But then running the code and triggering the event it throws an error as it doesn't like the (string,string,bool) method :-/
So, I have commented out the call which is throwing the error, put a break point in and then had a look via the Immediate window...
but....what didn't compile now runs in the in the immediate window..
screen shot for your pleasure...
it's as if two different dlls are being used. A little confused.
Thanks!
Peter
Almost looks like you are running two different binaries. Have you double checked that the Umbraco site runs on the same dll's as your visual studio when you build your project.
/Rune
Hey Rune,
I agree, it is exactly what it looks like and I have deleted all the references, then deleted the bin folder, re-added the references (the same ones to the different projects) and built.
I'll do it again. It's possible something didn't clear or something. I appreciate your thoughts though.
Peter
Hey Rune,
I am somehow back here and was trying to add a property in the c# event, but having the same things as explained previously. I knew i was having a feeling of de-ja-vu.
I think I previously got around it by passing in the new properties with the javascript and now doing anything in the event. That's not possible in what I need to do now.
So I have updated the dlls, - 2.1.3 looks like it's not going to be much help so i chose 1.4.4.5 which looks a little familier. I as there is no presentation dll in the zip, i seem to have issues with my tcbase javascript calls. What do i have to do to fix this? Should the dll be in the package? or should i have new references in the web.config?
Thanks in advance,
Peter
It looks like this is the problem ...
... so what should I do to fix? although I am using 4.7.1 :s
Hi Peter
You should change all the forms and JavaScript calls from "tcbase" to just the normal Umbraco base. That's it.
Kind regards
Anders
Thanks Anders. Unfortunatly I am now back to the orginial problem. :'(
This really makes no sense.
Have you upgraded your VS solution to build agains the Tea Commerce dll files that are used on the website? Those need to be the same. Be sure to check the path to the dll in VS so you know it is the right one.
Hey Anders, I am only running locally, which is why i can attach the debugger and use the Immediate window.
I did remove the references to old dlls, cleaned the solution (all projects) and then built to see the dlls were missing, then i added new references.
it's nuts.
Try to clean and rebuild. there must be something wrong or cahced somehow! :(
What you are saying is making sense and I agree with everything you are saying Anders, and i am trying. but it's just not making sense. I'll keep looking.
As I said at the beginning this is bound to be something simple and you'll be more than welcome to call me a n00b.
Out of interest, what version of the teacommerce.data had these methods in which it is looking for when running?
new OrderLineProperty(string,string,int?)
is there something I could look for to hunt out the old version? it must be referenced somewhere? like a config file or something.
It is properly from 1.3.0 where that was added.
is working on a reply...