Solved

Config File in VB.net

Posted on 2012-04-10
6
289 Views
Last Modified: 2012-06-21
Hi,

I am using simple Appsetting from Config file. I works from source. I also works on my machine if double click the exe. If I try to run the exe on a different machine, it acts like there is configuration file and does not any contents from Appsettings. Is there any reason for that?
0
Comment
Question by:sadimul
6 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 37828502
Have you delivered the <your application name>.exe.config in your bin\debug folder as well as your exe file to the new machine.  When you deliver the application to the end user, you have to deliver the exe and this new config file called <your application name>.exe.config and NOT the app.config. Users can modify the data in <your application name>.exe.config file and application will read the data from the config file, when restarted.
0
 
LVL 17

Expert Comment

by:nepaluz
ID: 37828545
Since you are simply deploying the exe file, you will have to set these settings in code. You can always do this in the form load event by checking whether the settings exist and if not write / set them,e.g for string setting  named DefComp, you'd do:
If String.IsNullOrEmpty(My.Settings.DefComp.ToString) Then
    My.Settings.DefComp = "The Default Setting"
    My.Settings.Save()
End If

Open in new window

0
 

Author Comment

by:sadimul
ID: 37828832
The exe and my <application name>.exe.config  are on the network share. If I double click the EXE from one machine, it works fine. If get onto another machine and double click the same EXE (without changing the path of the exe), it fails.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37835404
What's different between two machines? What version of .NET?
0
 

Accepted Solution

by:
sadimul earned 0 total points
ID: 37838016
It's same .net version. I created the solution added the modules and classes manually. It worked.
0
 

Author Closing Comment

by:sadimul
ID: 37854917
It worked after creating the new solution
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Vb. Net application freezes 9 46
Get the selected ValueMember of Combobox 5 30
VB.Net - TypeInitializer Error 25 27
Call windows 10 virtual keyboard from windows forms app 2 35
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question