Cannot build in WebGL for Unity

I thought this was going to be straight forward but I am have hit a road block with this and not sure how to proceed. I am on PC.

First of all, when I select build and run for WebGL, I get an invalid build path error UNLESS I choose the Unity Folder.

Then it appears to be working before stopping with the following errors:

UnauthorizedAccessException: Access to the path “C:/Program Files/Unity/Editor\Build” is denied.
System.IO.Directory.CreateDirectoriesInternal (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:131)
System.IO.Directory.CreateDirectory (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/Directory.cs:96)
UnityEditor.FileUtil.CreateOrCleanDirectory (System.String dir) (at C:/buildslave/unity/build/Editor/Mono/FileUtil.cs:249)
UnityEditor.WebGL.WebGlBuildPostprocessor.MoveOutputToInstallPath (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:887)
UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:949)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at C:/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:27)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:287)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

I have reinstalled Unity by re-running the Unity Download assistant and ensuring that WebGL was included, but it made no difference. My guess is it is some kind of permissions thing, but I am running with full administrator access so not sure what is wrong.

Any help much appreciated, thanks.

20 minutes later I got it working - as soon as I chose my Downloads folder it all worked, although I was prompted to allow an application through the firewall, as I suspected was a permissions issue - and the big scary error messages went away, I have now posted my uploaded game in separate post.

Worked, thank you

Privacy & Terms