System.IO.FileNotFoundException: Could not load file or assembly (System.Diagnostics.DiagnosticSource)

Hi all,

I’m facing this issue when debugging a Workflow.
The workflow debugs just fine untill it reaches the ‘Use Application/Browser’ activity. Then the following exception is thrown:

"
[System.IO.FileNotFoundException: Could not load file or assembly ‘System.Diagnostics.DiagnosticSource, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’. The system cannot find the file specified.
File name: ‘System.Diagnostics.DiagnosticSource, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’
at TelemetryClient.OpenTelemetry.TelemetryClientToOtelHelper.SetupActivitySyncOnOperationStart(IOperation iOperation)
at TelemetryClient.Contracts.TelemetryClientBuilder.TelemetryClient.StartOperation(TelemetryOperation telemetryOperation)
at UiPath.Shared.Telemetry.Services.TelemetryService.TrackExecutionOperationInternal(ExecutionOperation data)
at UiPath.Shared.Telemetry.Services.TelemetryServiceBase.TrackExecutionOperation(ExecutionOperation data)
at UiPath.Shared.Telemetry.Services.RuntimeTelemetryService.CreateExecutionOperation(Activity activity, ActivityContext context, String eventName)
at UiPath.Shared.Activities.AsyncTaskNativeActivity.CreateTelemetryOperation(NativeActivityContext context, Boolean fromCodedWf)
at UiPath.Shared.Activities.AsyncTaskNativeActivity.Execute(NativeActivityContext context)
at UiPath.Shared.Activities.ContinuableAsyncNativeActivity.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)]
"

Can someone please help?
I’ve already checked all the solutions suggested on

And none of the suggested solutions worked.

What is your Studio/Robot version?
Provide the project.json file. We need to see the dependencies.

We assume the version of UiPath.UiAutomation.Activities package, has the System.Diagnostics.DiagnosticSource sub-dependency version higher than the System.Diagnostics.DiagnosticSource version used in other sub-dependencies, and that is causing the compatibility issue.
You may need to downgrade the UiPath.UiAutomation.Activities package to a lower version (e.g. 24.10.x or 23.10.x).

My Studio version is 2023.10.5.

This is the project.json
{
“name”: “ExpressRecoveries_NESNA”,
“projectId”: “",
“description”: “Provider contract processing for the NESNA provider web application.”,
“main”: “Main.xaml”,
“dependencies”: {
“UiPath.Excel.Activities”: “[2.22.3]”,
“UiPath.Form.Activities”: “[24.10.5]”,
“UiPath.IntegrationService.Activities”: “[1.15.0]”,
“UiPath.MicrosoftOffice365.Activities”: “[3.0.14]”,
“UiPath.System.Activities”: “[25.4.4]”,
“UiPath.Testing.Activities”: “[23.10.1]”,
“UiPath.UIAutomation.Activities”: “[25.10.2]”
},
“webServices”: [],
“entitiesStores”: [],
“schemaVersion”: “4.0”,
“studioVersion”: “23.10.5.0”,
“projectVersion”: “1.0.0”,
“runtimeOptions”: {
“autoDispose”: false,
“netFrameworkLazyLoading”: false,
“isPausable”: true,
“isAttended”: false,
“requiresUserInteraction”: true,
“supportsPersistence”: false,
“workflowSerialization”: “DataContract”,
“excludedLoggedData”: [
"Private:
”,
password
],
“executionType”: “Workflow”,
“readyForPiP”: false,
“startsInPiP”: false,
“mustRestoreAllDependencies”: true,
“pipType”: “ChildSession”
},
“designOptions”: {
“projectProfile”: “Developement”,
“outputType”: “Process”,
“libraryOptions”: {
“includeOriginalXaml”: false,
“privateWorkflows”:
},
“processOptions”: {
“ignoredFiles”:
},
“fileInfoCollection”: [
{
“editingStatus”: “InProgress”,
“testCaseId”: “c119fbfb-1706-42ac-afe1-98180b69934e”,
“testCaseType”: “TestCase”,
“executionTemplateType”: “Local”,
“fileName”: “Tests\GetTransactionDataTestCase.xaml”
},
{
“editingStatus”: “InProgress”,
“testCaseId”: “d06afbec-3c8b-4ab1-b832-f7757ecf437b”,
“testCaseType”: “TestCase”,
“executionTemplateType”: “Local”,
“fileName”: “Tests\InitAllApplicationsTestCase.xaml”
},
{
“editingStatus”: “InProgress”,
“testCaseId”: “44b3074c-67f5-4314-8872-0aec82a0ce53”,
“testCaseType”: “TestCase”,
“executionTemplateType”: “Local”,
“fileName”: “Tests\InitAllSettingsTestCase.xaml”
},
{
“editingStatus”: “InProgress”,
“testCaseId”: “fa9649ef-a0c2-4e3d-b626-e9f33076f191”,
“testCaseType”: “TestCase”,
“executionTemplateType”: “Local”,
“fileName”: “Tests\MainTestCase.xaml”
},
{
“editingStatus”: “InProgress”,
“testCaseId”: “144e8aa5-4107-45b9-83e3-a7d1b4bb448b”,
“testCaseType”: “TestCase”,
“executionTemplateType”: “Local”,
“fileName”: “Tests\ProcessTestCase.xaml”
},
{
“editingStatus”: “InProgress”,
“testCaseId”: “1af40603-89d3-4118-bb34-b30343f36930”,
“testCaseType”: “TestCase”,
“executionTemplateType”: “Local”,
“fileName”: “Tests\WorkflowTestCaseTemplate.xaml”
}
],
“modernBehavior”: true,
“saveToCloud”: false
},
“expressionLanguage”: “VisualBasic”,
“entryPoints”: [
{
“filePath”: “Main.xaml”,
“uniqueId”: “*”,
“input”: ,
“output”:
}
],
“isTemplate”: false,
“templateProjectData”: {},
“publishData”: {},
“targetFramework”: “Windows”
}

I’ve tried downgrading UiPath.UiAutomation.Activities from version 25.10.2 to 24.10.13 before, but then my activities were having conflicts, so I wonder if there’s any solution that wouldn’t require me to rework on all these activites.

Hello Guys this issue is version capability.

You can check your UiPath studio version

Then you can use studio capability activity version.

For example..

your UiPath version 2024.10.1

Then you can use 2024.10.1 or below version activity packages.

Then your issue has been resolved

So my UiPath Studio version is 2023.10.5.
The package that I was supposed to downgrade has the description:
“IMPORTANT: This package version requires Studio 23.4 or higher. On lower versions some functionality may be missing, or unexpected behaviours may occur.”

So isn’t my version 23.10 and therefore higher than 23.4?

The downgrade of UiPath.UiAutomation.Activities package to a lower version (for example from 25.10 to 24.10 or from 24.10 to 23.10) may break your UI activities. The only solution will be either to redo manually the UI activities in the lower version of UiPath.UiAutomation.Activities package, or use the actual new version of UiPath.UiAutomation.Activities package.

For the new version UiPath.UiAutomation.Activities package (25.10.2), you may reconsider using the latest STS version 2025.0.167 from https://download.uipath.com/UiPathStudioCloud.msi for Studio and Robot, but also upgrade the other project dependencies to a more recent version.


Notes:

System.Diagnostics.DiagnosticSource.8.0.0 is part of UiPath.OpenTelemetry.Contracts.2.5.17

UiPath.OpenTelemetry.Contracts.2.5.17 is part of UiPath.Telemetry.Client.2.5.17

The UiPath.Telemetry.Client is part of UiPath.UiAutomation.Activities and UiPath.Excel.Activities

Under UiPath.UiAutomation.Activities.25.10.2 is UiPath.Telemetry.Client.2.5.17
Under UiPath.Excel.Activities is UiPath.Telemetry.Client.2.3.3

UiPath.OpenTelemetry.Contracts.2.3.3 needs actually System.Diagnostics.DiagnosticSource.6.0.0 and not System.Diagnostics.DiagnosticSource.8.0.0

In conclusion, the issue occurs between the used versions of UiPath.UiAutomation.Activities package and UiPath.Excel.Activities (incompatible version of System.Diagnostics.DiagnosticSource.8.0.0 with System.Diagnostics.DiagnosticSource.6.0.0).

Thanks for explaining that way Marian. I will try to use the newer version of Studio.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.