Share via

Issue while upgrading API Service from .Net 8.0 to .Net 10.0

Abdeali Mandviwala 20 Reputation points
2026-03-13T04:27:16.5466667+00:00

Hi, I am upgrading my API Service Application from .Net 8.0 to .Net 10.0.

There is an assembly which gets runtime generated from within another assembly whose framework version is netstandard 2.0.

Now, there is a powershell script which runs in Octopus Deploy and uses that runtime assembly. But it fails and gives error "Unable to find type [assembly name]".

The Powershell configured in Octopus Deploy is of Desktop Version(5.1). Can this be the reason?

The same script and code works fine in .Net 8.0.

Thanks

Developer technologies | .NET | .NET Runtime
0 comments No comments

1 answer

Sort by: Most helpful
  1. Gade Harika (INFOSYS LIMITED) 2,605 Reputation points Microsoft External Staff
    2026-03-13T04:38:54.6133333+00:00

    Thanks for reaching out.
    Yes, the PowerShell version is the root cause.

    Windows PowerShell 5.1 runs on .NET Framework, which has limited compatibility with modern .NET runtimes. When upgrading your application to .NET 10, the runtime‑generated assembly (even if created from a netstandard2.0 library) ends up depending on .NET 10 runtime components, which PowerShell 5.1 cannot load. This results in errors like:

    Unable to find type [AssemblyName]

    This is why the same setup worked with .NET 8 but fails after upgrading.

    Recommended solution: Configure the Octopus Deploy step to use PowerShell 7+ (pwsh). PowerShell 7 runs on modern .NET and fully supports loading netstandard2.0 and .NET 10 assemblies.

    Alternative workarounds (not recommended long‑term):

    • Ensure the generated assembly has no dependency on .NET 10 APIs
    • Generate the assembly outside PowerShell and only consume simple types
    • Downgrade the runtime target

    Switching to PowerShell 7 is the cleanest and supported fix.

    Let me know if you need any further help with this. I will be happy to assist. If you find this helpful, Kindly mark the provided solution as "Accept Answer", so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.