In Umbraco 13, access to generated models is denied in some environments

Hi, I am storing my generated models in an external library, which works fine on my local machine but once deployed to other environments I keep getting this access denied message. I don’t rebuild models on these environments but sometimes when I try to use usync access is denied again and it cancels. I have given full folder permissions in IIS.

An error occurred Access to the path
‘C:\inetpub\wwwroot\Libraries\Models\GeneratedModels’
is denied.

Exception Details System.UnauthorizedAccessException,
System.Private.CoreLib, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=7cec85d7bea7798e: Access to the path
‘C:\inetpub\wwwroot\Libraries\Models\GeneratedModels’
is denied.


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/114603-in-umbraco-13-access-to-generated-models-is-denied-in-some-environments