Workspace Assemblies

Referencing Assemblies and Sharing Code

OneStream allows you to share and reference workspace assemblies across different workspaces and maintenance units. This guide covers the setup, syntax, and best practices for creating assembly dependencies and referencing shared code.

Assembly Reference Relationships

diagramAssembly Reference Relationships

Loading diagram...

ArrowMeaning
Solid lineSame-workspace reference (no Is Shareable required when using Current)
Dashed lineCross-workspace reference (target must have Is Shareable = True)

Prerequisites & Setup

Making a Workspace Shareable

Before another workspace can reference your assembly, the source workspace must be marked as shareable:
  1. Go to Application > Presentation > Workspaces
  2. Select the workspace that contains the assembly you want to share
  3. Set Is Shareable Workspace = True
  4. Click Save
ℹ️Info
The Default workspace is always shareable and cannot be changed. If you use the Current keyword instead of an explicit workspace name, the Is Shareable property is not required.

Adding Shared Workspace Names

On the workspace that needs to consume the shared assembly:
  1. Open the workspace properties
  2. In Shared Workspace Names, enter a comma-separated list (no spaces) of workspace names you want to reference — e.g., SharedWorkspace1,SharedWorkspace2
  3. Click Save
The search order for items is: Current Workspace > Default Workspace > Shared Workspace Names (in the order entered).

Creating Assembly Dependencies

Dependencies tell OneStream's compiler which other assemblies your code needs. This is how you formally link assemblies together.
  1. In the Workspaces tree, expand your assembly
  2. Right-click the Dependencies label and select Add Dependency
  3. Choose the dependency type:
Dependency TypeUse Case
Workspace AssemblyReference another assembly (same or different workspace)
Prepackaged AssemblyReference a DLL included with the OneStream installation
Business RuleReference a business rule from the Business Rules page

Same Workspace, Different Maintenance Unit

diagramSame-Workspace Dependency

Loading diagram...

  • Select Workspace Assembly as the dependency type
  • Enter the Dependency Name (the assembly name)
  • Leave the Shared Workspace Name property empty — do not fill it in when referencing within the same workspace
  • Click Save

Different Workspace

  • Select Workspace Assembly as the dependency type
  • Enter the Dependency Name (the assembly name)
  • In the Shared Workspace Name property, enter the name of the workspace that contains the target assembly (multiple workspace names can be entered as a comma-delimited list)
  • The target workspace must have Is Shareable Workspace = True
  • Click Save

Referencing Syntax

General Pattern

The fully qualified reference syntax is:
plaintext
1Workspace.WorkspaceName.AssemblyName.FileName
Where:
  • WorkspaceName — the name of the workspace (or Current for the current workspace)
  • AssemblyName — the name of the assembly
  • FileName — the name of the specific file within the assembly

Using the Current Keyword

You can use Current in place of the workspace name to refer to the workspace containing the current object. This makes configurations more robust since references won't break if the workspace is renamed or duplicated.
plaintext
1Workspace.Current.AssemblyName.FileName
⚠️Warning
If you use an explicit workspace name (not Current), the referenced workspace must have Is Shareable Workspace = True, even if you are referencing a rule within the same workspace.

Syntax by Business Rule Type

XFBR (String Functions)

Standard (Business Rules page):
plaintext
1XFBR(RuleName, FunctionName)
Assembly version:
plaintext
1XFBR(Workspace.WorkspaceName.AssemblyName.FileName, FunctionName)
Example:
plaintext
1XFBR(Workspace.MNExamples.New.TestRule, SayHello)
2XFBR(Workspace.Current.New.TestRule, SayHello)

Dashboard Extender

Standard:
plaintext
1{MyDashboardExtenderBRName}{MyFunction}{Param1=[MyValue1],Param2=[MyValue2]}
Assembly version:
plaintext
1{Workspace.WorkspaceName.AssemblyName.FileName}{MyFunction}{Param1=[MyValue1],Param2=[MyValue2]}

Dashboard DataSet

Standard:
plaintext
1{MyDataSetBRName}{DataSetName}{Param1=[MyValue1],Param2=[MyValue2]}
Assembly version:
plaintext
1{Workspace.WorkspaceName.AssemblyName.FileName}{DataSetName}{Param1=[MyValue1],Param2=[MyValue2]}

Spreadsheet

plaintext
1Workspace.WorkspaceName.AssemblyName.FileName
ℹ️Info
You cannot use the ellipsis icon to select assembly-based spreadsheet rules. You must type the reference manually.

CubeView Extender

Set the custom report task to "Execute CubeView Extender Business Rule" and reference using:
plaintext
1Workspace.WorkspaceName.AssemblyName.FileName

Finance Business Rules (Cube Properties)

Reference from Cube Properties > Business Rules:
plaintext
1Workspace.MyWorkspaceNameOrNSPrefix.WS

Service Factory References

Service Factories can be referenced from configuration properties using these shorthand patterns. For a full overview of the Service Factory pattern, see Getting Started with Workspace Assemblies.
SyntaxBehaviorCan Be Used On
assemblyName.factoryNameLooks for factoryName in the specified assemblyMaintenance Unit, Workspace
WSMULooks at the Maintenance Unit first, then falls back to the WorkspaceDashboard Components
WSLooks at the Workspace level onlyDashboard Components
CurrentReferences the same Maintenance Unit containing the stepData Management Steps

Explicit Reference (for CubeViews, Cube Properties, etc.)

plaintext
1Workspace.MyWorkspace.MyMU.WSMU
Example — referencing a MemberList parameter from a CubeView:
plaintext
1[Workspace.MyWorkspace.MyMU.WSMU, MyMemberList]
Example — referencing a GetDataCell function:
plaintext
1GetDataCell("BR#[Workspace.MyWorkspace.MyMU.WSMU, MyDataCellFunction]"):Name(MyCheck)
⚠️Warning
CubeViews require all referenced factories to be in a shareable workspace, even if the Service Factory is in the same workspace as the CubeView. The syntax must be explicit.

Best Practices

  1. Keep assemblies in a single Maintenance Unit when possible to simplify management
  2. Use the Current keyword when referencing items within the same workspace to make your configuration more portable and resilient to renames
  3. Always set Is Shareable Workspace = True on any workspace you plan to reference from other workspaces
  4. Use explicit syntax in CubeViews — they always require the full Workspace.Name.MU.WSMU path, even for same-workspace references
  5. Avoid duplicate names between the Default workspace and custom workspaces, since the Default workspace can see all shareable workspaces
  6. Security: You must be part of the Administer Application Workspace Assemblies security role to edit assemblies

Quick Reference Table

ScenarioDependency SetupReference Syntax
Same workspace, same MUNo dependency needed (same assembly)Direct class/method call
Same workspace, different MUAdd Workspace Assembly dependency, leave Shared Workspace Name emptyWorkspace.Current.AssemblyName.FileName
Different workspaceAdd Workspace Assembly dependency, set Shared Workspace Name, source must be ShareableWorkspace.OtherWorkspaceName.AssemblyName.FileName
From a Business Rule (BR page) to an assemblyAdd assembly as Referenced Assembly on the BRWorkspace.WorkspaceName.AssemblyName (prefix starts with Workspace.)
In-code class reference (within assembly code)Add Workspace Assembly dependency (same as above scenarios)Workspace.{NamespacePrefix}.{AssemblyName}.{ClassName} or use Imports/using