Skip to content

Issue while upgrading the application from .Net 8.0 to .Net 10.0

0

Hi, I am upgrading my API Service Application from .Net 8.0 to .Net 10.0. Below is how the code looks like--

  1. There is a Powershell script which deploys the application and below piece of code executes within this script where the error arises (hiding dll name with ** for security concerns).

$scriptBlock = { param ($path, $assemblyPath) function GenerateSecurityMap { param () Add-Type -Path $assemblyPath $map = [**.**.Wcf.SecurityMapProvider]::GetSecurityMap() $jsonContent = $map | ConvertTo-Json -Depth 20 $jsonContent | Set-Content -Path $path } GenerateSecurityMap } $pwshOutput = & pwsh -Command $scriptBlock -Args $jsonPath, $CaiWcfAssemblyPath *>&1 | Tee-Object -Variable realtimeOutput

When the above script get executed in Octopus Deploy, I get the error "Unable to find type "..Wcf.SecurityMapProvider"". This particular assembly gets generated runtime(dynamically) within another assembly (..TestHarness.SecurityMapGenerator) which is based on .netstandard 2.0 like below-->

var sourceCode = $@" using System.Collections.Generic; using System.Text.Json; namespace **.**.Wcf {{ public static class SecurityMapProvider {{ public static Dictionary<string, Dictionary<string, string>> GetSecurityMap() => JsonSerializer.Deserialize<Dictionary<string, Dictionary<string, string>>>(@""{jsonContent.Replace("\"", "\"\"")}""); }} }}"; context.AddSource("SecurityMapProvider.g.cs", sourceCode); //context.AddSource("SecurityMapProvider.g.cs", SourceText.From(jsonContent, Encoding.UTF8));

..TestHarness.SecurityMapGenerator project file code--> <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>netstandard2.0</TargetFramework> <LangVersion>latest</LangVersion> <EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules> <IsRoslynComponent>true</IsRoslynComponent> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.CodeAnalysis.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.CodeAnalysis.CSharp" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> <PackageReference Include="Newtonsoft.Json" PrivateAssets="all"/> </ItemGroup> </Project>

Below are the version of references included in above project-- <PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0-2.final" /> <PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" /> <PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0" />

  1. Note that the pwsh (powershell) edition in Octopus Deploy is "Windows Powershell(Desktop)"
  2. All the above code works fine with .Net 8.0 but fails after upgrading to .Net 10.0
  • The question is more about .NET upgrade and less about AWS. Is this happening for a specific AWS service?

  • Hi @Shajam. Thanks for the reply. It happens within Codebuild. The Powershell runs within the codebuild hence I posted in this forum. If it sounds irrelevant in this forum I am happy to close it. Thanks

asked 2 months ago55 views
2 Answers
0

AWS CodeBuild does not currently provide native support for the .NET 10 SDK runtime. As a result, build and deployment scripts that functioned correctly under .NET 8 fail after the upgrade. According to the official AWS documentation, only specific .NET versions are available within the standard CodeBuild images, and .NET 10 is not yet included among the supported runtimes.

https://docs.aws.amazon.com/codebuild/latest/userguide/available-runtimes.html

https://repost.aws/questions/QUJHUOI5LuScmmHm67R1FlCw/codebuild-net-10-sdk-support

EXPERT
answered 2 months ago
0

For now, the .NET 10 SDK is not officially supported, and there is no ensured timeline to support it.

You can create your own base image, and refer to this official link: https://github.com/aws/aws-codebuild-docker-images to see how the official Base image built

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.