Solved

CS15425: Invalid expression term ')'

Posted on 2014-07-23
3
487 Views
Last Modified: 2014-07-23
This is really bugging me. I have code that works fine in VS 2013, but when I put it into my ASP.NET site I keep getting this error.

Code below:

Thread t1 = new Thread(() => CheckShare(ID, displayname, 1, canName, acctstatus));
----------------------------------^

From what the compiler is telling me the issue is with the first right parentheses bracket, but I dont get why it is an issue here. My VS project is .NET 2.0 and my site is running .NET 2.0.

Thanks
0
Comment
Question by:tr57285
3 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 40215455
VS 2013 is most likely using 4.5
Linq wasn't introduced till .Net 3.5 (I believe) . . . ergo the site doesn't know what to do with that syntax.

Try going to at least 3.5 if not 4.0.
0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 40215852
Linq wasn't introduced till .Net 3.5 (I believe)...
I think Kyle means "lambdas", not LINQ   ; )

As far as I can tell--because I can't really remember--lambas have been available since C# 2.0, .NET 2.0. In theory, it should work. If you take the lambda out of the picture, does the error go away?

You could also try using an anonymous delegate:

Thread t1 = new Thread(delegate() { CheckShare(ID, displayname, 1, canName, acctstatus); });

Open in new window

0
 

Author Closing Comment

by:tr57285
ID: 40215977
Brilliant. Worked as per the code change example.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question