Click here to Skip to main content
15,893,190 members
Please Sign up or sign in to vote.
2.00/5 (2 votes)
See more:
Dear all
I have an application that saves the connection string in App.config xml file, and I want to save the application .exe file in the server and to make a shortcut on the client computer, but I don't know if I need to make a copy from App.config on the client computer or not?
Posted

1 solution

No, this is not how it works. This file is translated to the file matching your application executable module file name + ".config". You can deploy/install it the same was as any other file you produce in your output directory by building the project.

Please see:
https://msdn.microsoft.com/en-us/library/ms229689%28v=vs.90%29.aspx[^],
https://msdn.microsoft.com/en-us/library/ms184658.aspx[^].

—SA
 
Share this answer
 
v2
Comments
fadi77_net 22-May-15 17:15pm    
regardless the name, I mean in case I want to create a shortcut from the exe file on the client, can I keep the .config and .exe files on the server and create a shortcut from the .exe on the client?
Sergey Alexandrovich Kryukov 22-May-15 17:39pm    
It's not "regardless" the name. It has nothing to do with "client" or "server" (aren't you mixing it with something else, such as Web.config?)
*.exe and *.exe.config are two files in the same directory. Any other files, "shortcuts" or anything else have nothing to do with this mechanism. This is the configuration for the application under the same matching name and same location, nothing else. After all, read it thoroughly.

If you mean some information shared between client and server, just explain your ultimate goal.

—SA
fadi77_net 23-May-15 16:18pm    
Dear friend
I want to let the user to save some information about his account in the .config file, and read it, and I want him to read the connection string from the .config file.
But I don't want to install the application on each client computer, I want to install it on the server and make a shortcut from the .exe file to each client computer, so in this case what should I do with .config file? Have I to copy it on the client computer or keep it on the server?
Sergey Alexandrovich Kryukov 23-May-15 21:43pm    
Then .config file is useless. I explained what it does. Just forget config files. If you have client and server, all communications between that should go from the same channel(s) as its regular communications. You always need to develop some application-layer protocol. For example, it could defined getting general server data right after connection.
—SA
fadi77_net 24-May-15 16:34pm    
But it is a shortcut from the original .exe file, and the original .exe file is on the server, is not it?

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