Solved

CS15425: Invalid expression term ')'

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

Expert Comment

by:Kyle Abrahams
Comment Utility
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 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
Comment Utility
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
Comment Utility
Brilliant. Worked as per the code change example.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now