Solved

Config File in VB.net

Posted on 2012-04-10
6
283 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now