visual studio – Access denied to .NET Standard 2.0 – Azure Function App


Everything on my laptop syncs to OneDrive, and I experience the following error message when trying to build my function app in Visual Studio.

The “GenerateFunctionMetadata” task failed unexpectedly. System.IOException: Access to the path “D:\Users\User\OneDrive\Desktop\Functions\FunctionName\obj\Debug\net8.0\WorkerExtensions\buildout\bin\runtimes\win\lib\netstandard2.0” is denied.

It seems to happen in the file Microsoft.Azure.Functions.Worker.Sdk.targets. It looks like it is trying to remove it. I have tried running Visual Studio as administrator, clean and rebuild the solution, deleting the debug-folder, yet without any luck.

Any ideas how to fix this?

Leave a Reply

Your email address will not be published. Required fields are marked *