hi, kindly help me to resolve the below issue.
I converted dll to nuget file and instakll into uipath, but i cant import my class library
hi, kindly help me to resolve the below issue.
I converted dll to nuget file and instakll into uipath, but i cant import my class library
is your package is visible in available packages�?
yeah⌠its installed and also there in C:\Program Files (x86)\UiPath Studio\Packages. but i canât import
no in Ui path when you try ti install is it visible under available in packages is my question not in your package directory.?
yeah⌠it visible
can you please provide what error you are getting when you tried to install the same?
i installed my custom package. when i try to import my class. i cant find anything
after installed my package. i restarted uipath & system also. but i canât import my class library in Imported Namespaces in UIPath
please check out the link this might help you same way i followed and am able to access my library in ui path
thanks divya⌠i found answer⌠we need to add the below class in our custom class library
public class RegisterMetadata : System.Activities.Presentation.Metadata.IRegisterMetadata
{
public void Register()
{
}
}
Hi Selvam/Divyashreem,
I created class library in C#, and in that I created one function whose work is send an string as a output. and Class is inherited with IRegisterMetaData.
public class Class1 : IRegisterMetadata
{
public static string GetName(int i)
{
if (i == 1)
{
return âI am oneâ;
}
else
{
return âI am twoâ;
}
}
public void Register()
{
}
}
Now, I created a package of this dll, and add it in UiPath packages folder and install it from UI.
then I take one assign activity and called the function as
ClassLibrary1.Class1.GetName(1), but when I run this then it gives me an error as mentioned below:
[Window Title]
Workflow Exception
[Main Instruction]
Main has thrown an exception
[Content]
Message: The invoked workflow âMainâ has validation errors. Please review the workflow and resolve the errors.
Exception Type: Exception
[Expanded Information]
System.Exception: The invoked workflow âMainâ has validation errors. Please review the workflow and resolve the errors. â> System.Activities.InvalidWorkflowException: The following errors were encountered while processing the workflow tree:
âMainâ: The private implementation of activity â1: Mainâ has the following validation error: Compiler error(s) encountered processing expression âClassLibrary1.Class1.GetName(1)â.
âClassLibrary1â is not declared. It may be inaccessible due to its protection level.
at System.Activities.Hosting.WorkflowInstance.ValidateWorkflow(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.Hosting.WorkflowInstance.RegisterExtensionManager(WorkflowInstanceExtensionManager extensionManager)
at System.Activities.WorkflowApplication.EnsureInitialized()
at System.Activities.WorkflowApplication.Enqueue(InstanceOperation operation, Boolean push)
at System.Activities.WorkflowApplication.SimpleOperationAsyncResult.Run(TimeSpan timeout)
at System.Activities.WorkflowApplication.BeginRun(AsyncCallback callback, Object state)
at UiPath.Executor.RobotRunner.<>c__DisplayClass49_0.b__0()
â End of inner exception stack trace â
Please help me on this.
Thanks
Harsh