New Posts New Posts RSS Feed: Argument types do not match
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Argument types do not match

 Post Reply Post Reply
Author
Mark.Bull View Drop Down
Newbie
Newbie


Joined: 31-Aug-2010
Posts: 4
Post Options Post Options   Quote Mark.Bull Quote  Post ReplyReply Direct Link To This Post Topic: Argument types do not match
    Posted: 31-Aug-2010 at 4:16am
Hi Guys,

I am evaulating your product and my manager wanted me to do a end to end testing on our dev server to make sure that its all good. So i started to play with your sample "FirstSilverlightApp" we are connection it to our dbmodel everthing is working fine on local maching and when we deploy it on to the server
We can Connect and Login no errors but when we click on Fetch I am running a simple query to fetch a Site table with below structure.

I have already spend good couple of days to fix this on dev server with iis7 .net 4.0 SQL 2008 64bit win 2008.

No Luck Please help ????????????? Thanks In advance

I am getting this error in error log on server

2010-08-31 22:48:10  IdeaBlade.EntityModel.Server EntityServerErrorHandler::ProvideFault Caught exception: System.ArgumentException: Argument types do not match at System.Linq.Expressions.Expression.Constant(Object value, Type type) at IdeaBlade.Linq.ConstantExpressionBlock.<ToExpression>b__0() at IdeaBlade.Linq.ExpressionBlock.GetExpression(Func`1 buildExpression) at IdeaBlade.EntityModel.EntityQuerySurrogate.set_SerializedExpression(SerializedExpression value) at ReadEntityQuerySurrogateFromXml(XmlReaderDelegator , XmlObjectSerializerReadContext , XmlDictionaryString[] , XmlDictionaryString[] ) at System.Runtime.Serialization.ClassDataContract.ReadXmlValue(XmlReaderDelegator xmlReader, XmlObjectSerializerReadContext context) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator reader, String name, String ns, Type declaredType, DataContract& dataContract) at System.Runtime.Serialization.XmlObjectSerializerReadContext.InternalDeserialize(XmlReaderDelegator xmlReader, Type declaredType, DataContract dataContract, String name, String ns) at System.Runtime.Serialization.DataContractSerializer.InternalReadObject(XmlReaderDelegator xmlReader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.XmlObjectSerializer.ReadObjectHandleExceptions(XmlReaderDelegator reader, Boolean verifyObjectName, DataContractResolver dataContractResolver) at System.Runtime.Serialization.DataContractSerializer.ReadObject(XmlDictionaryReader reader, Boolean verifyObjectName) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameterPart(XmlDictionaryReader reader, PartInfo part, Boolean isRequest) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeParameters(XmlDictionaryReader reader, PartInfo[] parts, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.DataContractSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest) at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)




----Tabel defination
CREATE TABLE [dbo].[Site](
    [SiteId] [int] IDENTITY(1,1) NOT NULL,
    [MasterSiteId] [int] NOT NULL,
    [Theme] [varchar](100) NULL,
    [CompanyName] [varchar](250) NULL,
    [Logo1] [varchar](250) NULL,
    [Logo2] [varchar](250) NULL,
    [Logo3] [varchar](250) NULL,
    [LogoPath] [varchar](50) NULL,
    [TaxLabel] [varchar](150) NULL,
    [TaxPercentage] [decimal](18, 2) NULL,
    [BillingCycle] [nchar](10) NULL,
    [DateCreated] [datetime] NULL,
    [ExpiryDate] [datetime] NULL,
    [Status] [int] NOT NULL,
    [CountryId] [int] NOT NULL,
    [ProductPriceGSTInc] [bit] NULL,
    [PhoneNumber] [varchar](50) NULL,
    [EmailId] [varchar](50) NULL,
    [BillNotes] [varchar](350) NULL,
    [LoyaltyPointRatio] [decimal](18, 2) NULL,
    [LoyaltyPointDuration] [int] NULL,
    [LoyaltyPointExpiry] [bit] NULL,
    [WholeSaleAndRetail] [bit] NULL,
    [CategoryOneLabel] [varchar](150) NULL,
    [CategoryTwoLabel] [varchar](150) NULL,
    [MarketingCategoryId] [int] NULL,
    [SearchBy] [varchar](50) NULL,
    [DiaryToDoStaffId] [int] NULL,
    [NewCustomerStaffId] [int] NULL,
    [InventoryStaffId] [int] NULL,
    [SmsUsername] [varchar](50) NULL,
    [SmsPassword] [varchar](50) NULL,
    [AppointmentSearchByCompany] [bit] NULL,
    [AppointmentNotesLabel] [varchar](50) NULL,
    [WelcomePack] [bit] NULL,
    [OwnerName] [varchar](50) NULL,
    [AptMoreStates] [bit] NULL,
    [BeautyIndustry] [bit] NULL,
    [TaxString] [varchar](250) NULL,
    [CanStaffDeleteApt] [bit] NULL,
    [CanStaffEditBill] [bit] NULL,
    [FilterClientsByStaff] [bit] NULL,
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 31-Aug-2010 at 9:57am

The error indicates that some constant in the query is of the wrong type, so please also post your query here.

Back to Top
Mark.Bull View Drop Down
Newbie
Newbie


Joined: 31-Aug-2010
Posts: 4
Post Options Post Options   Quote Mark.Bull Quote  Post ReplyReply Direct Link To This Post Posted: 31-Aug-2010 at 3:53pm
Thanks for a quick reply but I am not using any constants in query

 private void AddQueries()
        {             
_queries = new Dictionary<string, IEntityQuery>();

            _queries.Add("Get all Sites", _entityManager.Sites);
}

Just using the sample application to return the table

Just to complicate matter further. Our Entity model is in a class lib "POS.SL.BO" and "POS.SL.DomainModel" is a Silverlight lib which has reference to all the generated code from  "POS.SL.BO"

And we reference "POS.SL.DomainModel" from sample silverlight app.

Any help will be appreciated.

Thanks in advance

Mark


Edited by Mark.Bull - 31-Aug-2010 at 3:55pm
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 31-Aug-2010 at 6:47pm

I'm not sure I understand what's in these class libraries.  Is POS.SL.BO the assembly/project where the EDMX file was added, and POS.SL.DomainModel a Silverlight class library project with file links to the generated code?  Is POS.SL.BO a Silverlight or .NET class library?   Which assembly is in your web application's bin folder?

Is there any possibility that the DevForce assembly versions in the XAP vs. the web's bin folder are not the same?  Are all required DevForce and application assemblies in the bin folder?
 
Do your other queries work? 
Back to Top
Mark.Bull View Drop Down
Newbie
Newbie


Joined: 31-Aug-2010
Posts: 4
Post Options Post Options   Quote Mark.Bull Quote  Post ReplyReply Direct Link To This Post Posted: 31-Aug-2010 at 7:02pm
Thanks for your quick reply

1. Is POS.SL.BO the assembly/project where the EDMX file was added,

Yes

2. and POS.SL.DomainModel a Silverlight class library project with file links to the generated code?

Yes

3. Is POS.SL.BO a Silverlight or .NET class library?  

.Net class library

4. Which assembly is in your web application's bin folder?

POS.SL.BO.dll

5. Is there any possibility that the DevForce assembly versions in the XAP vs. the web's bin folder are not the same?

We have never used devforce before this is the first time we have installed and testing it.

6. Are all required DevForce and application assemblies in the bin folder?
 
yup

This are in web bin

IdeaBlade.Core
IdeaBlade.EntityModel
IdeaBlade.EntityModel.Edm
IdeaBlade.EntityModel.Server
IdeaBlade.EntityModel.Web
IdeaBlade.EntityModel
IdeaBlade.Linq
IdeaBlade.Validation

7. Do your other queries work?

Nope none of the queries work tried few no luck, login and connect seems to work and debug log is getting generated we can load the EntityService.svc without any errors.


Thanks once again for your help will be great if we can fix this






Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 01-Sep-2010 at 9:20am
Can you post or upload your debuglog here?  It might have something helpful.
Back to Top
Mark.Bull View Drop Down
Newbie
Newbie


Joined: 31-Aug-2010
Posts: 4
Post Options Post Options   Quote Mark.Bull Quote  Post ReplyReply Direct Link To This Post Posted: 01-Sep-2010 at 4:21pm
Hi Guys after spending few hours finally fixed it.

We had some other dlls in web bin which had a conflict with devforce ones.

I created a new asp.net 40 web application on server and it started to work.

then we stared to introduce one dll at a time and found the the one which was causing this error.

Thanks again for your help
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down