473,396 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VB dotnet application runs without app.exe.config file??

I built a VB.net application that makes use of a machine level DB
connection string setting, and a user level starting location setting.

The machine level setting and the default user based setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.

This is all well and good. My issue is this:

I was testing something, and removed my app.exe.config file from the
directory that my application is in. I also deleted the user.config
file that was created after first successful runs. Essentially, my
app has no config file to reference, so it should bomb on load,
right? (my app connects to a seperate SQL server to gather some data
that is presented on load.).

I loaded up the app, expecting an error, and for some reason, it did
not error!!! It loaded as if it used the default starting location I
specified in the config (0,0), and it connected to the database and
returned data with no problem!! How is this possible?!

The one thing to note is I have a local sql instance containing
roughly the same information as the production sql box. The only
difference is the prod sql server has a differently named database
than what I have local. With the config file, it connects to the
production sql server and pulls data from a db called "DB1". Without
the config file, the program connects to my local sql instance and
pulls data from a db called "DB2". I can't for the life of me
understand how this is happening.

Jul 11 '07 #1
5 7802
I suppose you've already searched your code for "DB1"? ;-)

<mm****@tampabay.rr.comwrote in message
news:11*********************@d55g2000hsg.googlegro ups.com...
>I built a VB.net application that makes use of a machine level DB
connection string setting, and a user level starting location setting.

The machine level setting and the default user based setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.

This is all well and good. My issue is this:

I was testing something, and removed my app.exe.config file from the
directory that my application is in. I also deleted the user.config
file that was created after first successful runs. Essentially, my
app has no config file to reference, so it should bomb on load,
right? (my app connects to a seperate SQL server to gather some data
that is presented on load.).

I loaded up the app, expecting an error, and for some reason, it did
not error!!! It loaded as if it used the default starting location I
specified in the config (0,0), and it connected to the database and
returned data with no problem!! How is this possible?!

The one thing to note is I have a local sql instance containing
roughly the same information as the production sql box. The only
difference is the prod sql server has a differently named database
than what I have local. With the config file, it connects to the
production sql server and pulls data from a db called "DB1". Without
the config file, the program connects to my local sql instance and
pulls data from a db called "DB2". I can't for the life of me
understand how this is happening.

Jul 12 '07 #2
The default settings are compiled in the assembly manifest

so even without a config file , it will stil use the default values , that
you specified in the designer ,
however if you change the values in the config file it wil use these values
handy huh ??? ;-)

regards

Michel
<mm****@tampabay.rr.comschreef in bericht
news:11*********************@d55g2000hsg.googlegro ups.com...
>I built a VB.net application that makes use of a machine level DB
connection string setting, and a user level starting location setting.

The machine level setting and the default user based setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.

This is all well and good. My issue is this:

I was testing something, and removed my app.exe.config file from the
directory that my application is in. I also deleted the user.config
file that was created after first successful runs. Essentially, my
app has no config file to reference, so it should bomb on load,
right? (my app connects to a seperate SQL server to gather some data
that is presented on load.).

I loaded up the app, expecting an error, and for some reason, it did
not error!!! It loaded as if it used the default starting location I
specified in the config (0,0), and it connected to the database and
returned data with no problem!! How is this possible?!

The one thing to note is I have a local sql instance containing
roughly the same information as the production sql box. The only
difference is the prod sql server has a differently named database
than what I have local. With the config file, it connects to the
production sql server and pulls data from a db called "DB1". Without
the config file, the program connects to my local sql instance and
pulls data from a db called "DB2". I can't for the life of me
understand how this is happening.

Jul 12 '07 #3
OK, so where is this assembly manifest? I don't find this handy.
When I deploy this app, if the config file is missing, I don't want
the program just trying to connect to some 'cached' value. I want it
to bomb like it is supposed to. Can I remove this from the manifest?

Here's another thing to note. I coded this program with only one
configuration setting initially, which was the DB string. I was
running this on my test computer fine. Because I did not code a
specific starting point, the app loads using the default setting which
I set via the IDE to "windows default". The application started as
such (near the middle of the screen).

I then made the changes to remember the starting location and added
the user based setting with default values 0,0. My application now
loads at 0,0. On subsequent opens, it will load in the last location
I had it. This works fine. Here's where it gets strange though.

On my test computer that ran the previous version of the app (without
starting location in config) will run the new EXE without a config
file, and it will default to 0,0. This is the issue I first
described.

I put v2 of the program on a new computer (one that has never ran any
version of the app before) and tried to run it without the config
file. The app bombed hardcore because it could not find the "starting
point" setting from the config file!!

On machine 1 (with previous copy of program), the app will run fine
without config file and run as if it "knew" about the starting
location setting even without the config file. But the new machine,
the program behaves as expectedly.. it doesn't detect the config file
setting, so it bombs.

This is weird!

On Jul 12, 12:14 pm, "Michel Posseth [MCP]" <M...@posseth.comwrote:
The default settings are compiled in the assembly manifest

so even without a config file , it will stil use the default values , that
you specified in the designer ,
however if you change the values in the config file it wil use these values

handy huh ??? ;-)

regards

Michel

<mmc...@tampabay.rr.comschreef in berichtnews:11*********************@d55g2000hsg.go oglegroups.com...
I built aVB.netapplicationthat makes use of a machine level DB
connection string setting, and a user level starting location setting.
The machine level setting and the default user based setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.
This is all well and good. My issue is this:
I was testing something, and removed my app.exe.config file from the
directory that myapplicationis in. I also deleted the user.config
file that was created after first successful runs. Essentially, my
app has no config file to reference, so it should bomb on load,
right? (my app connects to a seperate SQL server to gather some data
that is presented on load.).
I loaded up the app, expecting an error, and for some reason, it did
not error!!! It loaded as if it used the default starting location I
specified in the config (0,0), and it connected to the database and
returned data with no problem!! How is this possible?!
The one thing to note is I have a local sql instance containing
roughly the same information as the production sql box. The only
difference is the prod sql server has a differently named database
than what I have local. With the config file, it connects to the
production sql server and pulls data from a db called "DB1". Without
the config file, the program connects to my local sql instance and
pulls data from a db called "DB2". I can't for the life of me
understand how this is happening.- Hide quoted text -

- Show quoted text -

Jul 20 '07 #4
If you want the program to crash or behave different wel this is easy just
set a default value in the settings designer wich you detect at runtime
for the connection string you could set #var:notset# for instance for
numeric values you could use -1 or another value that you may detect as an
invalid parameter and detect this
I put v2 of the program on a new computer (one that has never ran any
version of the app before) and tried to run it without the config
file. The app bombed hardcore because it could not find the "starting
point" setting from the config file!!

On machine 1 (with previous copy of program), the app will run fine
without config file and run as if it "knew" about the starting
location setting even without the config file. But the new machine,
the program behaves as expectedly.. it doesn't detect the config file
setting, so it bombs.

This is weird!
That is indeed strange ,,,,,,, and i do not have a explanation for it ,
except if you provided a config file without the specific entry then it
would have made sense
in the case of not having a config file at all it should default to the
designer specific values ( 0,0 )

regards

Michel
<mm****@tampabay.rr.comschreef in bericht
news:11**********************@d55g2000hsg.googlegr oups.com...
OK, so where is this assembly manifest? I don't find this handy.
When I deploy this app, if the config file is missing, I don't want
the program just trying to connect to some 'cached' value. I want it
to bomb like it is supposed to. Can I remove this from the manifest?

Here's another thing to note. I coded this program with only one
configuration setting initially, which was the DB string. I was
running this on my test computer fine. Because I did not code a
specific starting point, the app loads using the default setting which
I set via the IDE to "windows default". The application started as
such (near the middle of the screen).

I then made the changes to remember the starting location and added
the user based setting with default values 0,0. My application now
loads at 0,0. On subsequent opens, it will load in the last location
I had it. This works fine. Here's where it gets strange though.

On my test computer that ran the previous version of the app (without
starting location in config) will run the new EXE without a config
file, and it will default to 0,0. This is the issue I first
described.

I put v2 of the program on a new computer (one that has never ran any
version of the app before) and tried to run it without the config
file. The app bombed hardcore because it could not find the "starting
point" setting from the config file!!

On machine 1 (with previous copy of program), the app will run fine
without config file and run as if it "knew" about the starting
location setting even without the config file. But the new machine,
the program behaves as expectedly.. it doesn't detect the config file
setting, so it bombs.

This is weird!

On Jul 12, 12:14 pm, "Michel Posseth [MCP]" <M...@posseth.comwrote:
>The default settings are compiled in the assembly manifest

so even without a config file , it will stil use the default values ,
that
you specified in the designer ,
however if you change the values in the config file it wil use these
values

handy huh ??? ;-)

regards

Michel

<mmc...@tampabay.rr.comschreef in
berichtnews:11*********************@d55g2000hsg.g ooglegroups.com...
>I built aVB.netapplicationthat makes use of a machine level DB
connection string setting, and a user level starting location setting.
The machine level setting and the default user based setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.
This is all well and good. My issue is this:
I was testing something, and removed my app.exe.config file from the
directory that myapplicationis in. I also deleted the user.config
file that was created after first successful runs. Essentially, my
app has no config file to reference, so it should bomb on load,
right? (my app connects to a seperate SQL server to gather some data
that is presented on load.).
I loaded up the app, expecting an error, and for some reason, it did
not error!!! It loaded as if it used the default starting location I
specified in the config (0,0), and it connected to the database and
returned data with no problem!! How is this possible?!
The one thing to note is I have a local sql instance containing
roughly the same information as the production sql box. The only
difference is the prod sql server has a differently named database
than what I have local. With the config file, it connects to the
production sql server and pulls data from a db called "DB1". Without
the config file, the program connects to my local sql instance and
pulls data from a db called "DB2". I can't for the life of me
understand how this is happening.- Hide quoted text -

- Show quoted text -


Jul 23 '07 #5
I don't know.. I'm confused.
That is indeed strange ,,,,,,, and i do not have a explanation for it ,
except if you provided a config file without the specific entry then it
would have made sense
in the case of not having a config file at all it should default to the
designer specific values ( 0,0 )
I don't know.. this is just crazy haha. All I know is

1) "new machine with no config file = bomb due to inability to find
value when my code tries to load it (starting point =
my.settings.startingpoint)".
2) Not sure if I noted previously, but the first version of the app
did not have this particular setting. I added it after the fact in a
subsequent rebuild. So a machine that was working with the original
config, can run the new app, even if the new setting isn't specified
at all (or even if the config file is flat out deleted, including from
user's appdata folder).
3) If I run the new version with latest config file at least once on
the new machine, and later delete the config file (including the user
stored config file in appdata) or simply just remove that value from
the config file, the program will start as if it can load that
settings, even though the setting doesn't exist.

I'll have to try some more testing when I get time.
On Jul 23, 1:27 am, "Michel Posseth [MCP]" <M...@posseth.comwrote:
If you want the program to crash or behave different wel this is easy just
set a default value in the settings designer wich you detect at runtime
for the connection string you could set #var:notset# for instance for
numeric values you could use -1 or another value that you may detect as an
invalid parameter and detect this
I put v2 of the program on a new computer (one that has never ran any
version of the app before) and tried to run it without the config
file. The app bombed hardcore because it could not find the "starting
point" setting from the config file!!
On machine 1 (with previous copy of program), the app will run fine
without config file and run as if it "knew" about the starting
location setting even without the config file. But the new machine,
the program behaves as expectedly.. it doesn't detect the config file
setting, so it bombs.
This is weird!

That is indeed strange ,,,,,,, and i do not have a explanation for it ,
except if you provided a config file without the specific entry then it
would have made sense
in the case of not having a config file at all it should default to the
designer specific values ( 0,0 )

regards

Michel

<mmc...@tampabay.rr.comschreef in berichtnews:11**********************@d55g2000hsg.g ooglegroups.com...
OK, so where is this assembly manifest? I don't find this handy.
When I deploy this app, if the config file is missing, I don't want
the program just trying to connect to some 'cached' value. I want it
to bomb like it is supposed to. Can I remove this from the manifest?
Here's another thing to note. I coded this program with only one
configuration setting initially, which was the DB string. I was
running this on my test computer fine. Because I did not code a
specific starting point, the app loads using the default setting which
I set via the IDE to "windows default". Theapplicationstarted as
such (near the middle of the screen).
I then made the changes to remember the starting location and added
the user based setting with default values 0,0. Myapplicationnow
loads at 0,0. On subsequent opens, it will load in the last location
I had it. This works fine. Here's where it gets strange though.
On my test computer that ran the previous version of the app (without
starting location in config) will run the new EXE without a config
file, and it will default to 0,0. This is the issue I first
described.
I put v2 of the program on a new computer (one that has never ran any
version of the app before) and tried to run it without the config
file. The app bombed hardcore because it could not find the "starting
point" setting from the config file!!
On machine 1 (with previous copy of program), the app will run fine
without config file and run as if it "knew" about the starting
location setting even without the config file. But the new machine,
the program behaves as expectedly.. it doesn't detect the config file
setting, so it bombs.
This is weird!
On Jul 12, 12:14 pm, "Michel Posseth [MCP]" <M...@posseth.comwrote:
The default settings are compiled in the assembly manifest
so even without a config file , it will stil use the default values ,
that
you specified in the designer ,
however if you change the values in the config file it wil use these
values
handy huh ??? ;-)
regards
Michel
<mmc...@tampabay.rr.comschreef in
berichtnews:11*********************@d55g2000hsg.go oglegroups.com...
I built aVB.netapplicationthat makes use of a machine level DB
connection string setting, and a user level starting location setting.
The machine level setting and the default user based setting is of
course stored in the app.exe.config file located in the same directory
as the exe. Upon closing the form, I save the user setting which then
creates a user.config file in the appdata directory in my profile.
This is all well and good. My issue is this:
I was testing something, and removed my app.exe.config file from the
directory that myapplicationis in. I also deleted the user.config
file that was created after first successful runs. Essentially, my
app has no config file to reference, so it should bomb on load,
right? (my app connects to a seperate SQL server to gather some data
that is presented on load.).
I loaded up the app, expecting an error, and for some reason, it did
not error!!! It loaded as if it used the default starting location I
specified in the config (0,0), and it connected to the database and
returned data with no problem!! How is this possible?!
The one thing to note is I have a local sql instance containing
roughly the same information as the production sql box. The only
difference is the prod sql server has a differently named database
than what I have local. With the config file, it connects to the
production sql server and pulls data from a db called "DB1". Without
the config file, the program connects to my local sql instance and
pulls data from a db called "DB2". I can't for the life of me
understand how this is happening.- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -

Jul 26 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: David Hughes | last post by:
For example, in Python in a Nutshell, Alex Martelli shows how you can run a Windows (notepad.exe) or Unix-like (/bin/vim) text editor using os.spawnv(os.P_WAIT, editor, ) But how would you call...
6
by: Dean R. Henderson | last post by:
I have a DTS Package I am able to execute successfully from a Windows Form application, but I cannot get this to work from an ASP.NET Web Service, although the Web Service impersonates the same...
21
by: Chris | last post by:
I'm trying to get an existing VS.NET project up on my Win2003 server and I get the following error (on the actual website page): "It is an error to use a section registered as...
7
by: Edward Yang | last post by:
In my test, I have two web applications app1 and app2, and I configure them as follows in IIS: $/comboapps |--web.config |--bin | app1.dll | app2.dll |--app1 | form1.aspx
8
by: Jay Balapa | last post by:
This am I posted the following message thinking there was a problem with Dot Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS 6.0 installed machines. I tested this on my laptop...
4
by: Ravi Ambros Wallau | last post by:
Hi: We developed a set of ASP.NET Web Applications that never runs in stand-alone mode, but always inside a portal (Rainbow Portal). All modules are copied on that portal. My question is: load...
2
by: Onur | last post by:
Hi.All I'm working on a TTS application. It runs on my local pc (WindowXP pro) without any error. Microsoft Visual Studio .NET 2003, Microsoft .NET Framework SDK v1.1, Microsoft Speech...
1
by: =?Utf-8?B?U1lFREhBTklG?= | last post by:
Hi Have installed vs.net 2005 professional edition and i am trying to run test web application it gives me following error in message box Microsoft Visual Studio Unable to start debugging...
5
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.