SectionGroupName is not valid

I try to add a service link, then I get this error.

"Invalid parameter" sectionGroupName "Parameter name: sectionGrouName"

  • Project launched .Net 3.5
  • When I upgrade my project to .Net 4.0, it works! but this is not an option for me, because other links use 3.5
  • Another VS computer is running 3.5 and can smoothly add wcf. This means that this only happens on my machine.
  • I tried to repair my .Net, but still the error persists.
  • Checked my web.config and machine.config, an invalid parameter named sectionGroupName.
  • Clear temporary files. An error has occurred.

Please, help. Thank you

+4
source share
2 answers

I also had this one. 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, it may be a programming error, for example, in the section Loading System.ServiceModel with the ConfigurationManager, "but suppose it is not. What can you do?

Locate the server.exe.config file (or create it if it does not exist) and modify or create the partition and add the following lines:

<startup>
    <supportedRuntime version="v4.0" />
</startup>
0
source

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:行号 15System.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 resolution just moves the section 'appSettings'after the section 'configSections'. Perhaps "configSections" should be the first child section of the configuration. This is strange!

0

Source: https://habr.com/ru/post/1532106/


All Articles