StandardCSharpReferencedAssemblies Property

MS Activities Extensions

Collapse image Expand Image Copy image CopyHover image
Gets the standard list of referenced assemblies for C# projects.

Namespace: Microsoft.Activities.Extensions
Assembly: Microsoft.Activities.Extensions (in Microsoft.Activities.Extensions.dll) Version: 2.0.6.9 (2.0.6.9)

Syntax

C#
public static IEnumerable<string> StandardCSharpReferencedAssemblies { get; }
Visual Basic
Public Shared ReadOnly Property StandardCSharpReferencedAssemblies As IEnumerable(Of String)
	Get
Visual C++
public:
static property IEnumerable<String^>^ StandardCSharpReferencedAssemblies {
	IEnumerable<String^>^ get ();
}

Remarks

Workflows typically reference a standard list of assemblies. This list will make it easier to create a reference list by combining the two

Examples

ReferencedAssemblies property that adds the StandardReferencedAssemblies collection to it's own
CopyC#
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="WorkflowCompiled.cs" company="Microsoft">
//   Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System.Collections.Generic;
using System.Reflection;

using Microsoft.Activities.Extensions;

/// <summary>
/// The WorkflowCompiled class
/// </summary>
// ReSharper disable CheckNamespace
public partial class WorkflowCompiled 
    // ReSharper restore CheckNamespace
{
    #region Constructors and Destructors

    /// <summary>
    /// Initializes a new instance of the <see cref="WorkflowCompiled"/> class.
    /// </summary>
    /// <param name="assemblyResolutionOption">
    /// The assembly resolution option.
    /// </param>
    public WorkflowCompiled(XamlAssemblyResolutionOption assemblyResolutionOption)
    {
        switch (assemblyResolutionOption)
        {
            case XamlAssemblyResolutionOption.VersionIndependent:
                this.InitializeComponent();
                break;
            case XamlAssemblyResolutionOption.FullName:
                StrictXamlHelper.InitializeComponent(this, this.FindResource(), ReferencedAssemblies);
                break;
        }
    }

    #endregion

    #region Public Properties

    /// <summary>
    /// Gets ReferencedAssemblies.
    /// </summary>
    public static IList<string> ReferencedAssemblies
    {
        get
        {
            // Create a list of activities you want to reference here
            // You must add the currently executing assembly
            var list = new List<string>
                {
                    "ActivityLibrary1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c18b97d2d48a43ab", 
                    Assembly.GetExecutingAssembly().GetName().FullName
                };

            // Add the standard list of references
            list.AddRange(StrictXamlHelper.StandardCSharpReferencedAssemblies);
            return list;
        }
    }

    #endregion
}

See Also