Click here to Skip to main content
15,888,321 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I made a program in VB.Net that acts as a VU meter and it shows the value on a progress bar(it is using My.Settings functions), and then I updated it with some code that is connected with DirectX sound. It works perfectly, but when I try to make a copy of the built program in another folder, it says that the configuration file is missing, when I copy the configuration file in the same folder with the program, it works. This means that I can't give the program to someone else, unless I give the configuration file as well ?
I had a problem with the Frameworks, but I figured it out, I just added this code to the configuration file:
XML
<startup useLegacyV2RuntimeActivationPolicy="true">
   <supportedRuntime version="v4.0"/>
 </startup>

Maybe that messed it up?

On other programs, the configuration file gets saved in the "Application Data" folder (%appdata%), (C:\Documents And settings\USER\Application Data)in XP.
Posted
Updated 5-Jan-13 13:03pm
v4

According to MSDN:

Application configuration files must be installed in the same location as the application's application manifest.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa374182(v=vs.85).aspx[^]
 
Share this answer
 
But how other programs work when the configuration folder isn't in the same folder with the program ?
 
Share this answer
 
Comments
Jibesh 5-Jan-13 21:29pm    
Please use the Comment Widget to post your comment do not use the solution field.

If your programs uses AppConfig then it MUST be copied along with your programs otherwise it wont work as expected. In other cases the exception was handled and the program uses the default values and not the Application Configuration data.

In other cases most of the application uses its own configuration files in the form of Xml,Database,text file etc.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900