Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameter 'sectionGroupName' is invalid

I am trying to add a service Reference, then I am getting this error.

"The parameter 'sectionGroupName' is invalid Parameter name: sectionGrouName"

  1. Project is running .Net 3.5
  2. When I upgrade my project to .Net 4.0 it works! but it this is not an option for me because other references uses 3.5
  3. Other's machine VS running 3.5 and can add wcf smoothly. It means it only happens on my machine.
  4. I tried repairing my .Net but still error persist.
  5. Checked my web.config and machine.config, no invalid parameter named sectionGroupName.
  6. Clean temporary files.Same error.

Please Help. Thanks.

like image 267
liss Avatar asked Mar 17 '14 09:03

liss


1 Answers

I got this error when I call 'ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None).SectionGroups["sectionGroupName"]' to get the configuration from App.config.

在 System.Configuration.MgmtConfigurationRecord.GetSectionGroup(String configKey)
   在 TestMonitor.Program.Main(String[] args) 位置 E:\Temp\TestThreads\TestMonitor\Program.cs:行号 15
   在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

My resolvent is just move the 'appSettings' section after to the 'configSections' section. Maybe the 'configSections' must be the first child section of configuration. That's queer indeed!

like image 52
Cameron Wu Avatar answered Nov 20 '22 20:11

Cameron Wu