Solved

CS15425: Invalid expression term ')'

Posted on 2014-07-23
3
513 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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