Invalid expression term object error in C#.Net SharePoint project

Here we will discuss how we can resolve the issue which comes while working with out parameter in C#.Net. We were working on an existing solution when we build the solution it gave error like below:

out object afterStatusVariable

SharePoint deveopment training course

Error comes as: Support all classes in the .NET Framework class hierarchy and provide low-level services to derived classes. This is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy. Invalid expression term ‘object’.



visual studio 2015 invalid expression term object
visual studio 2015 invalid expression term object

Read some sharepoint online tutorials:

Solution:
Instead of writing in the same function. We can declare it first and then we can use it like:

out afterStatusVariable

properties.ItemEventProperties.AfterProperties.TryGetValue(“Status”, afterStatusVariable)

Hope this will be helpful.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bhawana Rathore

Hello Everyone!! I am Bhawana a SharePoint MVP and having about 8+ years of SharePoint experience as well as in .Net technologies . I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools . Now exploring more in SharePoint 2016 :) Hope here I can contribute and share my knowledge to the fullest. As I believe "There is no wealth like knowledge, and no poverty like ignorance"

View all posts by Bhawana Rathore →