Search Issue Tracker
Fixed in 2019.2.X
Votes
8
Found in
2018.1.0b10
Issue ID
1012632
Regression
No
[HDRP] Generating shader includes is broken. Unity package cache permissions issue
How to reproduce:
1. Create empty new 3D project
2. Go to "Package Manager -> All" and install "Render-pipeline.lightweight 1.1.1"
3. In Editor click on Edit -> Render Pipeline -> Upgrade Project Materials...
4. Again, click on Edit -> Render Pipeline -> Generate Shader Includes
Actual result: Generate Shader Include doesn't work and it throws this exception:
UnauthorizedAccessException: Access to the path "C:\ProgramData\Unity\cache\packages\packages.unity.com\com.unity.render-pipelines.core@1.1.1-preview\CoreRP\GeometryUtils.cs.hlsl" is denied.
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:320)
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamWriter.cs:124)
System.IO.StreamWriter..ctor (System.String path, Boolean append)
(wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
System.IO.File.CreateText (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:159)
UnityEditor.Experimental.Rendering.CSharpToHLSL.GenerateAll () (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.render-pipelines.core@1.1.1-preview/CoreRP/Editor/ShaderGenerator/CSharpToHLSL.cs:101)
UnityEditor.Experimental.Rendering.ShaderGeneratorMenu.GenerateShaderIncludes () (at C:/ProgramData/Unity/cache/packages/packages.unity.com/com.unity.render-pipelines.core@1.1.1-preview/CoreRP/Editor/ShaderGenerator/ShaderGeneratorMenu.cs:10)
Reproduced with: 2018.1.0b12
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Linux] Top left corner of the screen is unresponsive when the Editor recompiles
- [Android] [Vulkan] Cubes stuck on the first few frames of rotation and application flickering when an Overlay Camera is added to the Camera Stack with MSAA enabled
- Profiling information icon does not update for Light Mode
- [Linux] Type to select functionality is missing for drop down menus
- TextMeshPro calculates Width Compression incorrectly when using certain values in the WD% field
dontdiedevelop
Jul 24, 2018 14:31
Same issue on 2018.2.0f2 64 bit
Asif362
Jun 21, 2018 02:16
I was facing the same issue but managed to solve it. I think it has nothing to do with write permissions. You are probably getting the error because you may have not included the renderingpipeline.core package from the package manager. Importing that package solved the issue for me at least. You should give that a try.
P.S- I know it's very late but someone else might come in to get help later.
Torigas
May 01, 2018 13:06
Potential fix:
Open the folder described in the error message, select all and remove the "read-only" flag.
Afterwards I didn't get errors when generating includes.
Torigas
May 01, 2018 13:03
Same issue with 2018.1f1
mosaic_school
Apr 09, 2018 12:04
Same on with the experimental Unity Linux Editor 2018.1.0b13 and Render-pipelines.core 1.1.2.
UnauthorizedAccessException: Access to the path "/home/micha/.config/unity3d/cache/packages/packages.unity.com/com.unity.render-pipelines.core@1.1.2-preview/CoreRP/GeometryUtils.cs.hlsl" is denied.
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/FileStream.cs:320)
System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share)
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor (string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.StreamWriter..ctor (System.String path, Boolean append, System.Text.Encoding encoding, Int32 bufferSize) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/StreamWriter.cs:124)
System.IO.StreamWriter..ctor (System.String path, Boolean append)
(wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor (string,bool)
System.IO.File.CreateText (System.String path) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/File.cs:159)
UnityEditor.Experimental.Rendering.CSharpToHLSL.GenerateAll () (at /home/micha/.config/unity3d/cache/packages/packages.unity.com/com.unity.render-pipelines.core@1.1.2-preview/CoreRP/Editor/ShaderGenerator/CSharpToHLSL.cs:101)
UnityEditor.Experimental.Rendering.ShaderGeneratorMenu.GenerateShaderIncludes () (at /home/micha/.config/unity3d/cache/packages/packages.unity.com/com.unity.render-pipelines.core@1.1.2-preview/CoreRP/Editor/ShaderGenerator/ShaderGeneratorMenu.cs:10)