Solved

Config File in VB.net

Posted on 2012-04-10
6
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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 Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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