Hi Sai,
I created a test VSTO2005 project named "Excel_Config" and was able to
retrieve a setting from the configuration file by naming the configuration
file "Excel_Config.dll.config" and placing it in the debug directory.
As a reference I've included the XML for the my configuration file below.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Name" value="Bob"/>
</appSettings>
</configuration>
Using the code below I was able to retrieve the value stored in the "Name"
key.
Dim setting As String
setting = System.Configuration.ConfigurationSettings.AppSett ings("Name")
MessageBox.Show(setting)
Hope this helps!
Regards,
Ken Laws
MSFT
This posting is provided "AS IS" with no warranties, and confers no rights.
For more information regarding Visual Studio Tools for Office 2005:
Best of Blogs: Visual Studio 2005 Tools for Office
http://msdn.microsoft.com/library/de...sto2005_ta.asp
Visual Studio Tools for Office Forum
http://forums.microsoft.com/msdn/Sho...spx?ForumID=16
Visual Studio Tools for the Microsoft Office System
http://msdn.microsoft.com/office/und...o/default.aspx
"Sai" wrote:
Hi,
I am using VSTO 2005 Beta for building an excel application. I added
application configuration file to the project (app.config) and it has the
following section in it.
<configuration>
<appSettings>
<add key="serv" value="test" />
</appSettings>
</configuration>
I am unable to get the value for key serv in my workbook startup event.
When I query
System.Configuration.ConfigurationManager.AppSetti ngs("serv").tostring, I
get a message saying that the value is nothig.
When I query the hasKeys property, I get FALSE.
I need help on understanding how I can use an external file to pass certain
parameters to my code.
I would really appreciate any help I can get.
Thanks,
sai