Developer technologies | Visual Studio | Setup
The process of installing, configuring, and customizing Visual Studio to support development workflows across languages, platforms, and workloads.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
For some reason MsBuild tag my obj\web.config as ReadOnly. I trying several time to find a workaround but without success.
ServiceApi failed with 1 error(s) (6.9s) → output\
C:\Program Files\dotnet\sdk\9.0.203\Sdks\Microsoft.NET.Sdk.Publish\targets\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(50,5): error MSB4018:
The "TransformWebConfig" task failed unexpectedly.
System.UnauthorizedAccessException: Access to the path 'D:\Projets\output\Web.config' is denied. at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite)
at Microsoft.NET.Sdk.Publish.Tasks.TransformWebConfig.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(TaskExecutionHost taskExecutionHost, TaskLogging
Context taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
At first it seem, after I track the file with Process Monitor, that is MsSense is locking the file. I add some exclusions to prevent MsSense to lock the file but without success.
After I try to avoid the task TransformWebConfig by:
It seem this error only happened with the SDK version of my projects. Old school project dont have this issue.