473,840 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7880
I suppose you've already searched your code for "DB1"? ;-)

<mm****@tampaba y.rr.comwrote in message
news:11******** *************@d 55g2000hsg.goog legroups.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****@tampaba y.rr.comschreef in bericht
news:11******** *************@d 55g2000hsg.goog legroups.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.c omwrote:
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...@tampaba y.rr.comschreef in berichtnews:11* *************** *****@d55g2000h sg.googlegroups .com...
I built aVB.netapplicat ionthat 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****@tampaba y.rr.comschreef in bericht
news:11******** **************@ d55g2000hsg.goo glegroups.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.c omwrote:
>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...@tampab ay.rr.comschree f in
berichtnews:11 *************** ******@d55g2000 hsg.googlegroup s.com...
>I built aVB.netapplicat ionthat 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.sta rtingpoint)".
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.c omwrote:
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...@tampaba y.rr.comschreef in berichtnews:11* *************** ******@d55g2000 hsg.googlegroup s.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". Theapplications tarted 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. Myapplicationno w
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.c omwrote:
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...@tampaba y.rr.comschreef in
berichtnews:11* *************** *****@d55g2000h sg.googlegroups .com...
I built aVB.netapplicat ionthat 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
7464
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 the OS X text editor /Applications/TextEdit.app - which appears to be a whole directory inside /Applications? I'm sorry if the answer is blindingly obvious. I work alone and sometimes just get stuck, then have to ask in public and risk appearing...
6
2054
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 user the Windows Form runs under. When I run the Web Service, I make a call to "System.Security.Principal.WindowsIdentity.GetCurrent().Name" and this verifies the user-id is the same account I am logged onto when I successfully run my Windows...
21
2183
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 allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS." I've been told by the previous developer that the website needs to be set as a "application". I...
7
1321
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
2428
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 running 5.1 and Framework 2.0 and runs perfectly fine. Can anyone from Microsoft help me. I have all our ASP.Net applications converted 2.0 and Iam left hanging with this bug. Jay
4
2219
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 time takes, sometimes, three or four of minutes in a medium-level machine (a PIII 1.5 Ghz), when the binary contents are changed, or if the time of last modification of the web.config file is changed. An application that runs in "stand-alone" mode...
2
4177
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 Application SDK 1.1. are installed on my local pc. My web server is Windows 2003 server Enterprise. Microsoft .NET Framework Version:1.1 and Microsoft Speech Server 2004 are installed on the server.
1
1100
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 on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside
5
2645
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. In a nutshell, I understand how this can be considered desireable by some, but I am not one of those people. My situation is that we have a root site (hosted @ http://www.mydomain.com) in the root application folder '/'.
0
9864
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10609
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10302
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9445
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7846
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7024
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3140
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.