bramdejager / spcb

The SharePoint Client Browser (SPCB) uses the CSOM to connect to a remote SharePoint site collection and shows the site structure with related properties and values.
GNU General Public License v2.0
173 stars 48 forks source link

Exception "Access to the path '...\SPCB.exe.Config' is denied. #101

Open nils-a opened 3 years ago

nils-a commented 3 years ago

I installed spcb in a location where users do not have write access, then start spcb as a normal user.

Would it be possible to store per-user settings in a user-configuration?

The full error I get is:

ex  {System.TypeInitializationException: The type initializer for 'SPBrowser.Globals' threw an exception. ---> System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\chocolatey\lib\spcb\tools\SPCB.exe.Config' 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, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.Configuration.Internal.WriteFileContext.ValidateWriteAccess(String filename)
   at System.Configuration.Internal.WriteFileContext.Complete(String filename, Boolean success)
   at System.Configuration.Internal.InternalConfigHost.StaticWriteCompleted(String streamName, Boolean success, Object writeContext, Boolean assertPermissions)
   at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext, Boolean assertPermissions)
   at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
   at System.Configuration.Internal.DelegatingConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
   at System.Configuration.UpdateConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
   at System.Configuration.MgmtConfigurationRecord.SaveAs(String filename, ConfigurationSaveMode saveMode, Boolean forceUpdateAll)
   at System.Configuration.Configuration.SaveAsImpl(String filename, ConfigurationSaveMode saveMode, Boolean forceSaveAll)
   at System.Configuration.Configuration.Save(ConfigurationSaveMode saveMode)
   at SPBrowser.Utils.ConfigUtil.GetOrCreateAppSetting(String key, Object defaultValue)
   at SPBrowser.Utils.ConfigUtil.GetOrCreateAppSetting(String key, Boolean defaultValue)
   at SPBrowser.Repositories.ConfigRepositoryAppConfig.<>c.<GetItems>b__2_3(ConfigurationItemBool x)
   at SPBrowser.Repositories.TypeSwitch.<>c__DisplayClass1_0`1.<Case>b__0(Object x)
   at SPBrowser.Repositories.TypeSwitch.Switch(Object x)
   at SPBrowser.Repositories.ConfigRepositoryAppConfig.GetItems()
   at SPBrowser.Managers.ConfigurationManager.GetAppConfig()
   at SPBrowser.Managers.ConfigurationManager..ctor()
   at SPBrowser.Globals..cctor()
   --- End of inner exception stack trace ---
   at SPBrowser.Globals.get_Configuration()
   at SPBrowser.Managers.TelemetryManager.Initialize()
   at SPBrowser.Managers.TelemetryManager..ctor()
   at SPBrowser.Program.Main(String[] args)}    System.Exception {System.TypeInitializationException}