Build automation - Deployment Center - failing System.Text.Json 8.0.0.4 - Including fix C# ASP.NET

Poelder, Niels 0 Reputation points
2024-11-25T15:42:56.3866667+00:00

I have getting an error with my latest build using DotNet 8.0 when using the "Deployment Center" on Azure which is connected to my git repo. I couldn't find a fix specifically online so I dug deeper and through trail and error I've come to this solution.

..... Could not load file or assembly 'System.Text.Json, Version=8.0.0.4,	

Regardless of SDK version you have selected as preffered, it seems to auto want to go for sdk version 9 of DotNet wich may not be desired.

I have come up with a simple workaround:

  1. Check out your versions of the DotNet in your application using console.
    afbeelding
  2. Create a global.json file with the following code:
       {  
        "sdk": {
           "version": "8.0.400" // Put your version here   
       	}
       }
    
  3. Commit and push the changes for the Deployment Center to run the auto build and now it should build :)
Developer technologies ASP.NET ASP.NET Core
Microsoft Security Intune Configuration Manager Deployment
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
Developer technologies C#
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2024-11-25T16:21:30.3166667+00:00

    System.Text.Json 8.0.0.4 has a security vulnerability and should not be used. 9 is the current version for all frameworks. You should update your nuget package references in the application project.


Your answer

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