Compilation failed due to: "The 'ILocalResource' type is defined in an assembly that is not referenced. You need to add a reference to the assembly 'UiPath.Platform, Version=23.4.0.0, Culture=neutral, PublicKeyToken=null'"

While Trying to update an existing library on Orchestrator I’m facing below error, this is happening with two libraries actually. I’ve updated all dependencies and still the error.

La compilación de ensamblado devolvió los siguientes errores:

  • El tipo ‘ILocalResource’ está definido en un ensamblado al que no se hace referencia. Debe agregar una referencia al ensamblado ‘UiPath.Platform, Version=23.4.0.0, Culture=neutral, PublicKeyToken=null’.

Xaml is compiled in Windows Legacy mode and this is also happening with another library.
Could you please help?

Studio Version: 2023.4.0
image

Hi @elsadev

just to confirm can you install the UiPath.platform package?

Regards

Hello Fernando, thanks for your reply.
Yes, I’ve installed that package but the issue still persists.

One Additional comment. Library has been created in Windows Legacy Mode, if I create a new project Windows mode there is no issue and I can upload sucessfully.

Please any advice/Help?

Try downgrading your versions to ones that aren’t pre-release and also maybe from 22.10

Windows legacy compatibility is stopping in the next release so don’t except new nuget packages to have good support in them.

Hi Jon, thanks for your reply.
I did the downgrade but still facing the same issue. Any other thoughts?
I have another library ( this is a library that I’m trying to deploy in the orchestrator) and I’m not facing this issue at all and all packages are updated to the latest version ( stable ones)

Is there a reason you need the UiPath.Platform library as that seems odd to me?
If you can answer that it might lead us in the right direction.

Otherwise, I have found occassionally that deleting the .local folder can clear some bad data (its a hidden folder in your project directory)

Actually I don’t need it and i’m not using it, I just added because of this issue but it is not fixing it.
I’ve tried creating a new package from scratch copying the xaml but the same issue
Also I’ve removed the .local
Also I’ve removed the UiPath.platform package

and we are having the same issue

If I were troubleshooting this, and I think I have had a similar issue but cannot remember exactly, I would start deleting workflows and trying to compile until I isolate which workflow is the issue.

In that workflow then add this to the references.

<AssemblyReference>UiPath.Platform</AssemblyReference>

You could alternatively just add it to every workflow you had.

I think when I experienced this it was from the offending workflow being very very old. Something go lost along the way and made it stop working.

2 Likes

Thanks for your reply Jon_Smith, I will follow your suggestion and get back with a conclusion.
Regards

My co-worker was getting the same issue when attempting to publish a library. We found out that selecting the “Compile activities expression” option in Publish options allowed for it to publish successfully without needing to adjust package or studio versions. We are on Studio 22.10.7 with same or newer packages.
image

Same error. Solved by manually adjusting the XAML file with

<AssemblyReference>UiPath.Platform</AssemblyReference>

Another way to say what J0ska did is to add the “UiPath.Platform” to the Imports tab in the bottom of the workflow.
image

2023-09-20 I was also getting the publish error (Legacy Windows Project):

  • The type ‘ILocalResource’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘UiPath.Platform, Version=23.4.1.0, Culture=neutral, PublicKeyToken=null’.

After adding the UiPath.Platform package under packages and adding the reference to “UiPath.Platform” the project published successfully.

1 Like