Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot get value from configuration file
Message
From
04/03/2015 08:28:17
 
 
To
03/03/2015 17:20:28
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 5.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01616171
Message ID:
01616200
Views:
30
>>I have a DLL library that uses a configuration file to get a value which can be set at the client.
>>The configuration file contains:
>>
>> <appSettings>
>>    <add key="CertificateSerialNumber" value="SerialNumber"/>
>>  </appSettings>
>>
>>In the code of the library I try to get the serial number:
>>
>>SerialNumber = ConfigurationSettings.AppSettings["CertificateSerialNumber"];
>>
>>Which works fine in debug, but when executing the code at the client, the subsequent error occurs:
>>
>>Value cannot be Null
>>
>>So I assume it cannot find the parameter I am looking for. The config file is in the same folder as the dll, so what am I missing?
>
>The config file is based off of the entry executable, not the dll (see https://msdn.microsoft.com/en-us/library/ms229689.aspx). Do you have the config file in the same folder as the exe and named after the exe?

I couldn't believe it. The issue is that I call the DLL from a VFP executable so I assumed it would not make sense to call it that way. But indeed when naming the config the same as the VFP exe it works. Thanks for the help.
Christian Isberner
Software Consultant
Previous
Reply
Map
View

Click here to load this message in the networking platform