7

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.

liss
  • 111
  • 1
  • 5
  • 2
    `Parameter name: sectionGrouName` - is that a mistake that you missed out the letter p - otherwise that might be your answer. – SpaceBison Mar 17 '14 at 09:21
  • "The parameter 'sectionGroupName' is invalid Parameter name: sectionGroupName" This is the error I'm getting. Sorry for typo. – liss Mar 17 '14 at 09:48
  • 1
    Do you have a `` tag anywhere that might be stopping you using different frameworks? Or anything that is specifically targeting .NET 3.5 – SpaceBison Mar 17 '14 at 09:54
  • No, I am not seeing this tag anywhere. Thank you for replying. – liss Mar 17 '14 at 10:07
  • 1
    Try creating a new project, and set the target framework to 3.5. Then see if you can add the reference to that project. – Shashank Chaturvedi Mar 17 '14 at 12:21
  • The same issue for a new project. I tried updating my windows. Still same error. – liss Mar 18 '14 at 03:01

2 Answers2

4

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!

Cameron Wu
  • 41
  • 5
0

I've had this one as well. My program crashes with the following message:

PS C:\Program Files\Inicorp\Server> .\server.exe
    System.ArgumentException: The parameter 'sectionGroupName' is invalid.
    Parameter name: sectionGroupName
       at System.Configuration.MgmtConfigurationRecord.GetSectionGroup(String configKey)
       at System.ServiceModel.Configuration.ServiceModelSectionGroup.GetSectionGroup(Configuration config)
       at (our code)
       at (our code)
       at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
       at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
       at (our code)

Yes, this may be a programming error, like in "Loading System.ServiceModel configuration section using ConfigurationManager", but let's assume it's not. What can you do?

Find your server.exe.config file (or create it if it doesn't exist) and modify or create the section and add these lines:

<startup>
    <supportedRuntime version="v4.0" />
</startup>
Community
  • 1
  • 1
Jonny
  • 1,453
  • 16
  • 25