I have a Windows Form Program that is erroring out the moment you try to open it. It is C# code using .Net 4.5.2 and runs on a shared RDS system:
Here is the error I get with in debug:
System.InvalidOperationException
HResult=0x80131509
Message=The key 'numUploadThreads' does not exist in the appSettings configuration section.
Source=System
StackTrace:
at System.Configuration.AppSettingsReader.GetValue(String key, Type type)
When I run it alone or using the debugger in Visual Studio 2017, there are no problems. Our staff share the RDS servers where this program is run. When I open it, no problem. When anyone else opens it, it fails. In order to better troubleshoot, I followed instructions in StackOverflow and I turned on Common Language Runtime Exceptions under Exception Settings and this is where I can force the error to occur for me.
In the project in Visual Studio I have a Properties/Settings.settings fiel and an App.config file
App.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="hdms.sourcecontrol.vault.promotiontool.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<connectionStrings>
<add name="hdms.sourcecontrol.vault.promotiontool.Properties.Settings.VPTConnectionString"
connectionString="Data Source=AZPRD1SQLCL1-SG\VAULT,61522;Persist Security Info=True;User ID=vpt"
providerName="System.Data.SqlClient" />
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup>
<applicationSettings>
<hdms.sourcecontrol.vault.promotiontool.Properties.Settings>
<setting name="numUploadThreads" serializeAs="String">
<value>1</value>
</setting>
</hdms.sourcecontrol.vault.promotiontool.Properties.Settings>
</applicationSettings>
</configuration>
Settings.settings
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="hdms.sourcecontrol.vault.promotiontool.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="VPTConnectionString" Type="(Connection string)" Scope="Application">
<DesignTimeValue Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<ConnectionString>Data Source=AZPRD1SQLCL1-SG\VAULT,61522;Persist Security Info=True;User ID=vpt</ConnectionString>
<ProviderName>System.Data.SqlClient</ProviderName>
</SerializableConnectionString></DesignTimeValue>
<Value Profile="(Default)">Data Source=AZPRD1SQLCL1-SG\VAULT,61522;Persist Security Info=True;User ID=vpt</Value>
</Setting>
<Setting Name="numUploadThreads" Type="System.String" Scope="Application">
<Value Profile="(Default)">1</Value>
</Setting>
</Settings>
</SettingsFile>
I cannot seem to add 'numUploadThreads' in either of these files that satisfy the error. The weirder part is that I am not using Threading.
How can I fix this error?
User contributions licensed under CC BY-SA 3.0