Code Source Files not working - shows error in Project Analyzer

I have added few c# classes to hold the data from one workflow to other , and some methods to get Json in order to call the API

I am able to run and debug the workflow but when I am trying to deploy - it shows below error
i am using - Community Studio - 2024.2.1


Error		Could not parse file D:\Code\Test_Flow.xaml. Reason: System.IO.FileLoadException: Could not load file or assembly 'Test_Integrations.Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Operation is not supported. (0x80131515)
File name: 'Test_Integrations.Core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
 ---> System.NotSupportedException: Resolving to a collectible assembly is not supported.
   at System.Reflection.RuntimeAssembly.<InternalLoad>g____PInvoke|49_0(NativeAssemblyNameParts* __pAssemblyNameParts_native, ObjectHandleOnStack __requestingAssembly_native, StackCrawlMarkHandle __stackMark_native, Int32 __throwOnFileNotFound_native, ObjectHandleOnStack __assemblyLoadContext_native, ObjectHandleOnStack __retAssembly_native)
   at System.Reflection.RuntimeAssembly.InternalLoad(AssemblyName assemblyName, StackCrawlMark& stackMark, AssemblyLoadContext assemblyLoadContext, RuntimeAssembly requestingAssembly, Boolean throwOnFileNotFound)
   at System.Reflection.TypeNameParser.ResolveAssembly(String assemblyName)
   at System.Reflection.TypeNameParser.GetType(String typeName, ReadOnlySpan`1 nestedTypeNames, String assemblyNameIfAny)
   at System.Reflection.TypeNameParser.NamespaceTypeName.ResolveType(TypeNameParser& parser, String containingAssemblyIfAny)
   at System.Reflection.TypeNameParser.GenericTypeName.ResolveType(TypeNameParser& parser, String containingAssemblyIfAny)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at UiPath.Studio.DataBaseServer.Shared.Parser.Extensions.ActivityModelExtensions.IsIfActivity(IActivityModel activityModel)
   at UiPath.Studio.DataBaseServer.Shared.Parser.Extensions.ActivityModelExtensions.IsActivityContainer(Activity activity, IActivityModel parent)
   at UiPath.Studio.DataBaseServer.Shared.Parser.Services.WorkflowParser.ParseActivity(Activity activity, IActivityModel parent, IWorkflowElement immediateParent, IActivityContext parentContext, IWorkflowParseContext workflowParseContext, Boolean useWorkflowViewState)
   at UiPath.Studio.DataBaseServer.Shared.Parser.Services.WorkflowParser.ParseActivity(Activity activity, IActivityModel parent, IWorkflowElement immediateParent, IActivityContext parentContext, IWorkflowParseContext workflowParseContext, Boolean useWorkflowViewState)
   at UiPath.Studio.DataBaseServer.Shared.Parser.Services.WorkflowParser.ParseActivity(Activity activity, IActivityModel parent, IWorkflowElement immediateParent, IActivityContext parentContext, IWorkflowParseContext workflowParseContext, Boolean useWorkflowViewState)
   at UiPath.Studio.DataBaseServer.Services.Workflow.DbWorkflowParser.<>c__DisplayClass11_0.<Parse>b__0()
   at UiPath.Studio.Workflow.Shared.Utilities.MetadataUtils.ExecuteWithMetadataStoreExceptionRetryInternal(Action action, Boolean continueOnCapturedContext, Int32 retryCount, Int32 retryAttemptDelayMs, Func`2 delayFunc)
   at UiPath.Studio.DataBaseServer.Services.Workflow.DbWorkflowParser.Parse(String fileName, String projectDirectory, CancellationToken cancellationToken)

I would try saving and restarting.

If that does not work, maybe try this: c# - System.IO.FileLoadException: 'Could not load file or assembly ‘EntityFramework or one of its dependencies. Access is denied.’ - Stack Overflow

I am not using any dll - code is in project in code source files

Can you try it in the Stable 23.10 release? Its better to work with that than community on some of the newer features like Coded Workflows. They are still changing them alot.

If it still happens then its maybe an issue with your classes and you can share them? I have quite some experience trying to get them stable, there are some ‘fussy’ parts to them.

Hi @Vikrant_Bagal

Does this mean that you are getting this error when you are trying to publish the project from Studio?

Would it be possible for you to share a zip of a sample project that reproduces this issue for you?

Hello @Vikrant_Bagal ,

thx for the feedback.
We have logged a bug in our system and a currently looking into it.
It would be very helpful if you could share the project used as a zip.

BR
Thomas

Auth0.InactiveUser.Collector.zip (285.9 KB)

Hi, im also getting the same error. The error does not occur when runnin in process in studio, only when trying to run the workflow analyzer and trying to publish.

Form my tests, the error is beign caused by the “For Each” activity, removing it from my workflow stoped the error.

There are a ton of issues with the Workflow Analyzer and coded workflows and they are many false positives even though the code is fine. I have had to work around it several times by publishing via command line to skip the annoying analyzer, and the code compiles just fine.

I have given feedback before begging that they allow us to fully turn off the analyzer or make it so we can override its findings as I feel like this would go quite some way to solving this issue.

1 Like

The coded workflows/souce files doest give me a “ready to production” confidence yet. Everytime I use it, I get a lot of compilation issues and errors. Sometime I can only solve them by creating a new project and starting eveything from scratch.

This one I got last time, it was related to using a custom class with the For-each activity. Other time it was because of the workflow analyze, and the list goes on.

Unfortanelly I have the same experience with other features of the platform.

I really like how UiPath is giving more attention to the developer experience, and always giving us new features that could help us, but sometime I fell that they lack some quality control.

Yeah I get where you come from.

I get to talk to many of the product managers as an MVP and its something they are aware of (this quality control issue). The challenge is to not lose momentum is releasing new features, as the tech is moving really fast, but still maintain a higher standard. Certain areas are worse than others. I’ve been trying to push for better consistency in documentation at least as we are always needing to figure out if the behaviour is a feature or a bug, and new features are often totally undocumented and we have to figure it out ourselves.

They have slowed down releases, moving from 2 LTS releases a year to 1, in the hope of providing more stable code once a year, but of course that might lead to a rushed release because if you miss the window you wait a year. They are trying to get us great new features, but I’d agree that balance of quality isn’t quite right everywhere yet. Still I’d rather have these features than not.

The coded workflows are actually really really great, and in my opinion the source files part is the best part, as you using it, to make custom classes.

To try to give some troubleshooting tips. The code gets proactively compiled during design time and gets stored in the .local folder in your project folder. If you get stuck, something you can try is to go into that folder and delete the .codedworkflows folder (you can actually delete alot there but may lose some project settings). When you re-open, Studio can recompile the files fresh and it sometimes fixes things.

Glad to read that. I agree with you, documentation is one of the weak points of UiPath right now.

About deleting the .local folder files, I do that, more than I should to tell the thuth, the last problem I got was related about how the workflow file didn’t manage to find the coded souce file assembly file, but somehow that is happening only to For-Each activities :face_with_diagonal_mouth:
I “fixed” that by not using those acitivites anymore and instead calling a invoke code and there ding the for each.

But, besides all that, I feel that UiPath still is the best RPA tools out there. And even with some consistency issues, the last few releases brought so much that I found hard to even get the desire to try other tool.