Unable to deploy function using .NET Core SDK 5.0.102 on Big Sur 11.1
See original GitHub issueDescription
When attempting to deploy a serverless ASP.NET Core Lambda function using dotnet lambda deploy-serverless
, the CLI tool fails with an MSBuild error and the dotnet
application crashes.
Could not load file or assembly 'System.Net.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
This occurs when using the .NET Core SDK 5.0.102 on macOS Big Sur 11.1. Note: Downgrading to .NET Core SDK 3.1.405 resolves the issue.
Reproduction Steps
- Create a new blank serverless ASP.NET Core Lambda function.
- Attempt to deploy the function using
dotnet lambda deploy-serverless
using Terminal. - The error below is thrown in the output.
Logs
... publish: MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
... publish: Microsoft.Build.BackEnd.NodeFailedToLaunchException: Could not load file or assembly 'System.Net.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
... publish: (0x8007001F)
... publish: ---> System.IO.FileLoadException: Could not load file or assembly 'System.Net.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. A device attached to the system is not functioning.
... publish: (0x8007001F)
... publish: File name: 'System.Net.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
... publish: at System.Diagnostics.Process.OpenStream(Int32 fd, FileAccess access)
... publish: at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
... publish: at System.Diagnostics.Process.Start()
... publish: at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
... publish: at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
... publish: --- End of inner exception stack trace ---
... publish: at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
... publish: at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.GetNode(String msbuildLocation, String commandLineArgs, Int32 nodeId, INodePacketFactory factory, Handshake hostHandshake, NodeContextTerminateDelegate terminateNode)
... publish: at Microsoft.Build.BackEnd.NodeProviderOutOfProc.CreateNode(Int32 nodeId, INodePacketFactory factory, NodeConfiguration configuration)
... publish: at Microsoft.Build.BackEnd.NodeManager.AttemptCreateNode(INodeProvider nodeProvider, NodeConfiguration nodeConfiguration)
... publish: at Microsoft.Build.BackEnd.NodeManager.CreateNode(NodeConfiguration configuration, NodeAffinity nodeAffinity)
... publish: at Microsoft.Build.Execution.BuildManager.PerformSchedulingActions(IEnumerable`1 responses)
... publish: at Microsoft.Build.Execution.BuildManager.HandleNewRequest(Int32 node, BuildRequestBlocker blocker)
... publish: at Microsoft.Build.Execution.BuildManager.ProcessPacket(Int32 node, INodePacket packet)
... publish: at Microsoft.Build.Execution.BuildManager.<>c__DisplayClass70_0.<Microsoft.Build.BackEnd.INodePacketHandler.PacketReceived>b__0()
... publish: at Microsoft.Build.Execution.BuildManager.ProcessWorkQueue(Action action)
... publish: --- End of stack trace from previous location ---
... publish: at Microsoft.Build.Execution.BuildManager.EndBuild()
... publish: at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, TextWriter targetsWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler, Boolean interactive, Boolean isolateProjects, Boolean graphBuild, Boolean lowPriority, String[] inputResultsCaches, String outputResultsCache)
Environment
- Build Version: Amazon Lambda Tools for .NET Core applications (5.0.0)
- OS Info: macOS Big Sur 11.1
- Build Environment: Visual Studio | VSCode + Terminal
dotnet
- Targeted .NET Platform: .NET Core 3.1 LTS
Resolution
No resolution, only workaround is to remove SDK 5.0.102 from the system.
- 👋 I can/would-like-to implement a fix for this problem myself
This is a 🐛 bug-report
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Azure function build pipeline fails and getting error i.e. ...
I have deployed the my changes to azure function and deployed for the same but while building pipeline it fails in build solution...
Read more >Started to get "This project is targeting a version of .NET ...
I'm getting this same issue with ASP.Net Core 3.1. The solution has been fine for two years and now it want's to install...
Read more >VS for Mac 2019 (8.10.13 build 11) will not find .NET 6 SDK ...
I have installed the .NET 6 SDK and cannot get Visual Studio for Mac to discover that as a target framework.
Read more >Visual Studio 2019 unable to locate .Net Core SDK
Step 1) First run dotnet --list-sdks from the command line (as in Grzegorz Smulko's answer). Take note of the greatest version number.
Read more >Visual Studio 2019 Not Showing .NET 5 Framework
NET project in Visual Studio from the .NET 4.7.2 framework to .NET 5. I can't figure out what the problem is, because I've...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone else who encounters this issue and uses ESET: I encountered this same problem and it was due to the
Enable Real-time file system protection
checkbox being checked in ESET.I will try to reproduce this on macOS Catalina and let you know the results. I’m not sure if this is AWS Lambda Tools issue though since the error occurs during MSBuild process.