R
Rich
Hello,
I picked up this example on using the Reflection namespace
for loading forms/classes on the fly at msdn
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnadvnet/html/vbnet10082002.asp
which uses a config file named "yourAppName.exe.config"
which is an xml based config file that references dlls in
other projects to load their forms/classes on the fly.
This config file resides in the bin directory of the
app's .exe. The example works great (although written in
vb.net2002 - for vb.net2003 need to instantiate a var:
ClassConfigValues = New Specialized.NameValueCollection )
The problem I am having is that when I run the app in
debug mode - the app's bin gets recreated each time, and I
have to manually recreate/copy the config file into the
bin. The config file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="availableclasses"
type="System.Configuration.NameValueSectionHandler" />
</configSections>
<availableclasses>
<add key="First Form"
value="C:\Newforms\FirstForm.dll~FirstForm.Form1"></add>
<add key="Second Form"
value="C:\Newforms\SecondForm.dll~SecondForm.Form1"></add>
<add key="Third Form"
value="C:\Newforms\ThirdForm.dll~ThirdForm.Form1"></add>
</availableclasses>
</configuration>
Is there a way for vb.net2003 to add this config file to
the bin at rebuild time? Or is it a deal where you create
the app and manually add the file yourself?
Thanks,
Rich
I picked up this example on using the Reflection namespace
for loading forms/classes on the fly at msdn
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnadvnet/html/vbnet10082002.asp
which uses a config file named "yourAppName.exe.config"
which is an xml based config file that references dlls in
other projects to load their forms/classes on the fly.
This config file resides in the bin directory of the
app's .exe. The example works great (although written in
vb.net2002 - for vb.net2003 need to instantiate a var:
ClassConfigValues = New Specialized.NameValueCollection )
The problem I am having is that when I run the app in
debug mode - the app's bin gets recreated each time, and I
have to manually recreate/copy the config file into the
bin. The config file looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="availableclasses"
type="System.Configuration.NameValueSectionHandler" />
</configSections>
<availableclasses>
<add key="First Form"
value="C:\Newforms\FirstForm.dll~FirstForm.Form1"></add>
<add key="Second Form"
value="C:\Newforms\SecondForm.dll~SecondForm.Form1"></add>
<add key="Third Form"
value="C:\Newforms\ThirdForm.dll~ThirdForm.Form1"></add>
</availableclasses>
</configuration>
Is there a way for vb.net2003 to add this config file to
the bin at rebuild time? Or is it a deal where you create
the app and manually add the file yourself?
Thanks,
Rich