Solved

CS15425: Invalid expression term ')'

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

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

803 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