Open jonmeyerson opened 7 months ago
@joj here's another - I've made a new label called 'Area-esproj' for tickets related to the javascript project system. It would be great if your team could periodically check this label for untriaged items.
This was related to
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '6.0.419'
after removing the explicit SDK version in the yaml pipeline, I followed the workaround here: https://github.com/dotnet/sdk/issues/39148 and it build successfully.
Workaround branch: https://github.com/jonmeyerson/Microsoft.VisualStudio.JavaScript.Sdk-AzureDeploy/tree/workaround
Also, i noticed if i did the build of the client app before setting the sdk version it worked, without https://github.com/dotnet/sdk/issues/39148 - but then the build later on for server that references client would still have the issue. Also, besides the dotnet task, having a global.json in the server project with
{
"sdk": {
"version": "6.0.419"
}
}
Will also indicate the System.Text.Json is not found.
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.
File name: 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
at Microsoft.VisualStudio.JavaScript.Tasks.GeneratePackageJsonProps.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
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]
I have the same problem/error, I don't understand the workaround? Can you explain how you got it to work?
I have the same problem/error, I don't understand the workaround? Can you explain how you got it to work?
You can see the first branch here that has the issue, and the commit that fixes it. https://github.com/jonmeyerson/Microsoft.VisualStudio.JavaScript.Sdk-AzureDeploy/commit/d47af92d67f742700806e3b38d096f66e86d3802
Unfortunately I don't use Azure Pipelines, but an Dockerfile to build an image with the dotnet application. I only could fix it by upgrading to .NET 8. I don't know if it works with .NET 7 as well, but switching the SDK worked for me. It seems that the .NET 6 SDK have a problem building an Docker image with the JavaScript SDK.
/cc: @joj
It sounds like this might be resolved in later versions. Can you triage this when you get the chance?
I am facing a similar issue. Please help me and provide a solution.
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
https://github.com/jonmeyerson/Microsoft.VisualStudio.JavaScript.Sdk-AzureDeploy
Exceptions (if any)
`Build FAILED.
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) )