Reputation: 3
Getting following error when using custom json configuration file.
Severity Code Description Project File Line Suppression State
Error The "SlowCheetah.TransformTask" task failed unexpectedly.
System.UnauthorizedAccessException: Access to the path 'D:\Data\…\Settings.Release.json' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.VisualStudio.Jdt.JsonTransformation..ctor(String transformFile, IJsonTransformationLogger logger)
at Microsoft.VisualStudio.SlowCheetah.JsonTransformer.Transform(String sourcePath, String transformPath, String destinationPath)
at Microsoft.VisualStudio.SlowCheetah.TransformTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() OzCruisingHangfireAgent.Program
Best Regards,
Damodar
Upvotes: 0
Views: 2818
Reputation: 10582
This is a known issue.
The JSON transformer in SlowCheetah v3.1.66 doesn't support the source or transform files being read-only yet.
See the following issues:
https://github.com/Microsoft/slow-cheetah/issues/86
https://github.com/Microsoft/json-document-transforms/issues/16
The merged PR#17 has a fix for Microsoft.VisualStudio.Jdt, but it hasn't been released yet.
Here are a few work arounds:
For example:
<Attrib Files="D:\Data\…\Settings.Release.json" Normal="true"/>
For example:
<Exec Command="attrib -R "D:\Data\…\Settings.Release.json""/>
Upvotes: 3