Monodevelop - runs only using sudo

2019-05-23 01:59发布

问题:

I've installed Mono and Monodevelop on my Debian amd64 jessie build, and I can only run monodevelop using elevated privilege.

Starting monodevelop from the UI startesque menu results in nothing appearing to happen. Starting monodevelop from a shell results in the following error:

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for MonoDevelop.Core.LoggingService ---> System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section (/usr/lib/monodevelop/bin/MonoDevelop.exe.config line 3) at System.Configuration.ConfigInfo.ThrowException (System.String text, System.Xml.XmlReader reader) [0x00000] in :0 at System.Configuration.SectionGroupInfo.ReadContent (System.Xml.XmlReader reader, System.Configuration.Configuration config, Boolean overrideAllowed, Boolean root) [0x00000] in :0 at System.Configuration.SectionGroupInfo.ReadRootData (System.Xml.XmlReader reader, System.Configuration.Configuration config, Boolean overrideAllowed) [0x00000] in :0 at System.Configuration.Configuration.ReadConfigFile (System.Xml.XmlReader reader, System.String fileName) [0x00000] in :0 at System.Configuration.Configuration.Load () [0x00000] in :0 at System.Configuration.Configuration.Init (IConfigSystem system, System.String configPath, System.Configuration.Configuration parent) [0x00000] in :0 at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000] in :0 at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object[] hostInitConfigurationParams) [0x00000] in :0 at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x00000] in :0 at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in :0 --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in :0 at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in :0 at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in :0 at System.Configuration.ConfigurationSettings.GetConfig (System.String sectionName) [0x00000] in :0 at System.Diagnostics.DiagnosticsConfiguration.get_Settings () [0x00000] in :0 at System.Diagnostics.TraceImpl.InitOnce () [0x00000] in :0 at System.Diagnostics.TraceImpl.get_Listeners () [0x00000] in :0 at System.Diagnostics.Debug.get_Listeners () [0x00000] in :0 at MonoDevelop.Core.LoggingService..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at MonoDevelop.Ide.IdeStartup.Main (System.String[] args, MonoDevelop.Ide.Extensions.IdeCustomizer customizer) [0x00000] in :0 at MonoDevelop.Startup.MonoDevelopMain.Main (System.String[] args) [0x00000] in :0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for MonoDevelop.Core.LoggingService ---> System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section (/usr/lib/monodevelop/bin/MonoDevelop.exe.config line 3) at System.Configuration.ConfigInfo.ThrowException (System.String text, System.Xml.XmlReader reader) [0x00000] in :0 at System.Configuration.SectionGroupInfo.ReadContent (System.Xml.XmlReader reader, System.Configuration.Configuration config, Boolean overrideAllowed, Boolean root) [0x00000] in :0 at System.Configuration.SectionGroupInfo.ReadRootData (System.Xml.XmlReader reader, System.Configuration.Configuration config, Boolean overrideAllowed) [0x00000] in :0 at System.Configuration.Configuration.ReadConfigFile (System.Xml.XmlReader reader, System.String fileName) [0x00000] in :0 at System.Configuration.Configuration.Load () [0x00000] in :0 at System.Configuration.Configuration.Init (IConfigSystem system, System.String configPath, System.Configuration.Configuration parent) [0x00000] in :0 at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000] in :0 at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object[] hostInitConfigurationParams) [0x00000] in :0 at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x00000] in :0 at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in :0 --- End of inner exception stack trace --- at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in :0 at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in :0 at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in :0 at System.Configuration.ConfigurationSettings.GetConfig (System.String sectionName) [0x00000] in :0 at System.Diagnostics.DiagnosticsConfiguration.get_Settings () [0x00000] in :0 at System.Diagnostics.TraceImpl.InitOnce () [0x00000] in :0 at System.Diagnostics.TraceImpl.get_Listeners () [0x00000] in :0 at System.Diagnostics.Debug.get_Listeners () [0x00000] in :0 at MonoDevelop.Core.LoggingService..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at MonoDevelop.Ide.IdeStartup.Main (System.String[] args, MonoDevelop.Ide.Extensions.IdeCustomizer customizer) [0x00000] in :0

Running monodevelop from a shell using sudo monodevelop runs absolutely fine. I've purged all (and I do mean all) the mono packages and re-installed but the error persists. The packages I'm installing are from the mono package repository as outlined here.

It would seem to be a permissions issue but I can't for the life of me work out what folder or file could be causing this. I've spent the last 2 days trying to figure this out and have got absolutely nowhere at all, so if anyone has any ideas or has come across this problem before, I'd love to hear about it.

Thanks, Mike

回答1:

Look for permission errors with strace. Usually when a program can only be run as root it means that some files are unreachable, except when root.

strace monodevelop

I had the same issue myself. I did

strace monodevelop > user.txt
sudo strace monodevelop > root.txt
diff user.txt root.txt > diff.txt

And then I searched for the problematic files.

In the end this actually didn't help me. I eventually uninstalled, and reinstalled mono, and everything related to it. Hopefully either solution will help.



标签: linux mono