Solved

Config File in VB.net

Posted on 2012-04-10
6
293 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

839 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