TestingFramework icon indicating copy to clipboard operation
TestingFramework copied to clipboard

Logic App Unit Test Framework Fails to Start – System.Runtime.InteropServices.OSPlatform Load Error Since 2025-05-08

Open Veera-Pipuri opened this issue 6 months ago • 2 comments

I've been using the Logic App Unit Test Framework reliably for an extended period on my local machine without issues. However, starting on 2025-05-08, it suddenly began failing to start locally. I haven't made any changes to the framework code or my setup, so this appears to be an unexpected regression

below are the error details :

Error building configuration in an external startup class. Microsoft.Azure.Workflows.WebJobs.Extensions: Could not load type 'System.Runtime.InteropServices.OSPlatform' from assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

A host error has occurred during startup operation Microsoft.Azure.WebJobs.Script: Error building configuration in an external startup class. Microsoft.Azure.Workflows.WebJobs.Extensions: Could not load type 'System.Runtime.InteropServices.OSPlatform' from assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

Host startup operation has been canceled. LogicAppUnit.TestException: Functions runtime did not start properly. Please make sure you have the latest Azure Functions Core Tools installed and available on your PATH environment variable, and that Azurite is running.

Image

Veera-Pipuri avatar May 09 '25 04:05 Veera-Pipuri

Hi @Veera-Pipuri , I don't believe that this is related to the unit testing framework - it relates to an issue with the Logic App extension in VS Code: https://learn.microsoft.com/en-us/answers/questions/2264356/logic-app-standard-workflow-fails-to-open-in-visua

Is your Logic App development environment working correctly?

mark-abrams avatar May 09 '25 15:05 mark-abrams

Hi @mark-abrams,

While running test cases using the unit test framework, I started getting above error all of sudden. I suspect that a recent update to one of the NuGet packages may have affected the Azure Functions runtime startup.

Previously, the following configuration worked perfectly:

host. json

"extensionBundle": {
  "id": "Microsoft.Azure.Functions.ExtensionBundle",
  "version": "[4.*, 5.0.0)"
}

And in local.settings.json:

"FUNCTIONS_WORKER_RUNTIME": "dotnet"

This setup ran fine since the begining, and the tests executed successfully. However, all of a sudden, the function runtime started failing, and tests would not run.

To troubleshoot, I changed the configuration to:

host.json

"extensionBundle": {
  "id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
  "version": "[1.*, 2.0.0)"
}

And updated the runtime to:

"FUNCTIONS_WORKER_RUNTIME": "node"

I also manually downloaded the Microsoft.Azure.Functions.ExtensionBundle.Workflows to: C:\Users\test.azure-functions-core-tools\Functions\ExtensionBundles\Microsoft.Azure.Functions.ExtensionBundle.Workflows\1.19.21

After these changes, the function runtime started successfully, and the test scripts executed without issues.

Do you think a recent update (e.g., NuGet packages, extension bundle, or Azure Functions Core Tools) could have caused the unit test framework to break?

Veera-Pipuri avatar May 09 '25 23:05 Veera-Pipuri

Yes, I believe that this is related to a recent update to Logic Apps. There are quite a few posts on the Internet about it.

Therefore I am going to close this issue.

mark-abrams avatar Jun 28 '25 09:06 mark-abrams