?
Solved

Config File in VB.net

Posted on 2012-04-10
6
Medium Priority
?
300 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

765 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