Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4605056
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:22:49+00:00 2026-05-22T00:22:49+00:00

I’m creating a custom workflow activity in VS2010 targeting .NET 3.5. The DLL is

  • 0

I’m creating a custom workflow activity in VS2010 targeting .NET 3.5. The DLL is actually being used in a Microsoft System Center Service Manager custom workflow, but I don’t think that is my issue.

I have a public string property, that the user types in the string of what the activity should use. However, when the WF runs, it errors out ‘value cannot be null’. I want to target if it is my code or something else.

When we drag my custom activity onto the designer, I’m able to type in the text of the string on the designer for that property.

public static DependencyProperty ChangeRequestStageProperty = DependencyProperty.Register("ChangeRequestStage", typeof(String), typeof(UpdateChangeRequestStage));

    [DescriptionAttribute("The value to set the ChangeRequestStage Property in the ChangeRequest Extension class.")]
    [CategoryAttribute("Change Request Extension")]
    [BrowsableAttribute(true)]
    [DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)]
    public String Stage
    {
        get { return ((String)(base.GetValue(UpdateChangeRequestStage.ChangeRequestStageProperty))); }
        set { base.SetValue(UpdateChangeRequestStage.ChangeRequestStageProperty, value); }
    }

    protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
    {
        EnterpriseManagementGroup emg = CreateEMG();

        //System.WorkItem.ChangeRequest Extension - ClassExtension_928bec0a_cac4_4a0a_bd89_7146c9052fbe
        ManagementPackClass mpcChangeRequest = emg.EntityTypes.GetClass(new Guid("8c6c6057-56ad-3862-47ec-dc0dde80a071"));

        //System.WorkItemContainsActivity Relationship Class
        ManagementPackRelationship workItemContainsActivityRelationship = emg.EntityTypes.GetRelationshipClass(new Guid("2DA498BE-0485-B2B2-D520-6EBD1698E61B"));

        EnterpriseManagementObject changeRequest = null;

        //Loop thru each emo (Change Request in this case), and assign it. There will never be more than 1 emo returned
        foreach (EnterpriseManagementObject obj in emg.EntityObjects.GetRelatedObjects<EnterpriseManagementObject>(executionContext.ContextGuid, workItemContainsActivityRelationship, TraversalDepth.OneLevel, ObjectQueryOptions.Default))
        { changeRequest = obj; }

        EnterpriseManagementObjectProjection emop = new EnterpriseManagementObjectProjection(changeRequest);

        if (emop != null)
        { emop.Object[mpcChangeRequest, "ChangeRequestStage"].Value = Stage; }

        emop.Commit();

        return base.Execute(executionContext);
    }

Since it is getting a ‘value cannot be null’ error, I’m guessing it’s on this line:

emop.Object[mpcChangeRequest, "ChangeRequestStage"].Value = Stage;

I’m going to test and see if hardcoding a value works or not. Any ideas?
enter code here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:22:50+00:00Added an answer on May 22, 2026 at 12:22 am

    I didn’t want to leave this question wide open, so I’m updating it as to how I resolved this (a long time ago).

    Rather than working with an EnterpriseManagementObjectProjection (emop), I worked with a standard EnterpriseManagementObject (emo). From there, I was able to follow a similar format from above:

    ManagementPackClass mpcChangeRequest = emg.EntityTypes.GetClass(new Guid("8c246fc5-4e5e-0605-dc23-91f7a362615b"));
    changeRequest[mpcChangeRequest, "ChangeRequestStage"].Value = this.Stage;
    changeRequest.Commit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.