NET SDK with Microsoft.VisualStudio.JavaScript.SDK dependency results in System.Text.Json - File not found through when specifying NET SDK Version

Open
#39,152 7 comments 6 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

Area-esproj untriaged
Describe the bug

Building a .NET 6 App that references a Microsoft.VisualStudio.JavaScript.SDK fails on Azure DevOps and produces an error indicating a missing dependency to System.Text.Json

Note: Deploying through Visual Studio 2022 Publish works as expected to Azure Resource.

To Reproduce

A simple project created following the guide here, https://learn.microsoft.com/en-us/visualstudio/javascript/tutorial-asp-net-core-with-vue?view=vs-2022

  1. Started a new project in VS 2022 of type "Vue and ASP.NET Core (Javascript)"
  2. Upgraded Microsoft.VisualStudio.JavaScript.SDK to 1.0.586930
  3. Changed Port in vite.config to match generated port in server. (step does not matter for build)
  4. Created .azureDevops folder with yaml for building the project.
  5. Imported yaml as a new pipeline and run the pipeline.

https://github.com/jonmeyerson/Microsoft.VisualStudio.JavaScript.Sdk-AzureDeploy

Exceptions (if any)

`Build FAILED.

   "D:\a\1\s\AzureDeploymentTest.sln" (Restore target) (1) ->
   "D:\a\1\s\azuredeploymenttest.client\azuredeploymenttest.client.esproj" (_GenerateProjectRestoreGraph target) (3:6) ->
   (GeneratePackageJsonProps target) -> 
     C:\Users\VssAdministrator\.nuget\packages\microsoft.visualstudio.javascript.sdk\1.0.586930\Sdk\Sdk.targets(259,5): error MSB4018: The "GeneratePackageJsonProps" task failed unexpectedly. [D:\a\1\s\azuredeploymenttest.client\azuredeploymenttest.client.esproj]
   C:\Users\VssAdministrator\.nuget\packages\microsoft.visualstudio.javascript.sdk\1.0.586930\Sdk\Sdk.targets(259,5): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. [D:\a\1\s\azuredeploymenttest.client\azuredeploymenttest.client.esproj]
   C:\Users\VssAdministrator\.nuget\packages\microsoft.visualstudio.javascript.sdk\1.0.586930\Sdk\Sdk.targets(259,5): error MSB4018: File name: 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' [D:\a\1\s\azuredeploymenttest.client\azuredeploymenttest.client.esproj]
   C:\Users\VssAdministrator\.nuget\packages\microsoft.visualstudio.javascript.sdk\1.0.586930\Sdk\Sdk.targets(259,5): error MSB4018:    at Microsoft.VisualStudio.JavaScript.Tasks.GeneratePackageJsonProps.Execute() [D:\a\1\s\azuredeploymenttest.client\azuredeploymenttest.client.esproj]
   C:\Users\VssAdministrator\.nuget\packages\microsoft.visualstudio.javascript.sdk\1.0.586930\Sdk\Sdk.targets(259,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:\a\1\s\azuredeploymenttest.client\azuredeploymenttest.client.esproj]
   C:\Users\VssAdministrator\.nuget\packages\microsoft.visualstudio.javascript.sdk\1.0.586930\Sdk\Sdk.targets(259,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [D:\a\1\s\azuredeploymenttest.client\azuredeploymenttest.client.esproj]

0 Warning(s)
1 Error(s)`
Further technical details

.NET SDK 6.0.419
Microsoft.VisualStudio.JavaScript.Sdk/1.0.586930
dev.azure.com - Azure Devops ( Version Dev19.M234.1 (AzureDevOps_M234_20240228.4) )

Dominant language
C#
Stars
3.2k
Forks
1.3k
Avg merge
4d 1h
Merged PRs (30d)
235

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/sdk

All issues in dotnet/sdk

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.