0
I have an application developed with Windows Form C# + Entity Framework V6.1.3, where I use an existing database. The application works correctly, in Visual Studio 2013, where I am developing.
My App.config
owns the ConnectionStrings
as follows:
<connectionStrings>
<add name="RHContext" providerName="System.Data.SqlClient"
connectionString="Server=SERVER;Database=BASE;
Trusted_Connection=false;Persist Security Info=True;User Id=USUARIO;
Password=SENHA;MultipleActiveResultSets=True"
</connectionStrings>
And like I said, it works normally.
The problem is that I need to take to production environment, ie publish.
Using the option Publish
from Visual Studio itself, it generates the executable, along with other files, which are these:
And inside the briefcase Application Files
I own these others:
Note that I have a file .condif
, but if I change the connectionStrings
directly in this file, I get this error while running the .exe
Unable to download the application. Not all files required by the application are available.
When I return to the connectionStrings
for the original, works normally.
This application will "run" on different machines, so I need a way for the technician to change the connectionStrings
, not needing the programmer.
And hence my doubt arises: How to change the connectionStrings
of the application, after publishing the application?
I thought of creating a file txt
and read the connectionStrings
but I don’t know if it’s viable, or if there’s a better way to do it.
I found the file, and it worked. But will these "strange names" always be the same? It is that we have many clients, and I need to document the form of installation. Keep putting "Strange Name" would catch "bad".
– Randrade
The option to create a TXT file to read would be unfeasible?
– Randrade