Open
Description
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
- Started a new project in VS 2022 of type "Vue and ASP.NET Core (Javascript)"
- Upgraded Microsoft.VisualStudio.JavaScript.SDK to 1.0.586930
- Changed Port in vite.config to match generated port in server. (step does not matter for build)
- Created .azureDevops folder with yaml for building the project.
- 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) )