Hello,
I try to implement some helper classes in a C# project, but after validation, building and closing and opening the project, the namespace of the project is still not visible.
What I did:
Created a Code Source File-> Created a simple string static method
Validate the project->Build de project->Close and reopen the project
Data Manager->Namespaces-> Add the project namespace found in the CS file
Message box Activity-> Call the method ()
I tried the same approach with a VB project and it worked like a charm.
There are restrictions with C# projects?
C# libraries require an explicit class wrapper and matching namespace structure before UiPath can detect them.
VB allows free‑floating functions, but C# does NOT.
Make sure your code contains
- A namespace that matches the folder/project name
- A public class
- A public static method
You may refer this example
namespace MyLibrary
{
public class Helper
{
public static string SayHello()
{
return "Hello from C#";
}
}
}
``
-
Once the source file is saved then validate the C# library and bulid a project
-
Data Manager → Namespaces → Add MyLibrary
-
In the workflow
MyLibrary.Helper.SayHello()
@Stefan_Iulian You’re not doing anything wrong—this is actually a known limitation with C# projects in UiPath Studio.Unlike VB projects, C# projects don’t fully support exposing custom namespaces from code files into the Imports/Namespaces panel. So even if your project builds fine and the namespace exists in your .cs file, it may still not show up or work as expected in activities like Message Box.
Workaround:
- Use Invoke Code (C#) to call your helper methods directly
- Or move your helper classes into a compiled DLL and reference it in the project