Solved

CS15425: Invalid expression term ')'

Posted on 2014-07-23
3
499 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 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