I have written a little console application that uses s#arp. I can
create an executable using the configuration manager and selecting
release. I understand that the dlls are needed and that there is
apparently no easy way to ‘bind’ (?) everything into one executable:
Is there at least a way to hide:
NHibernate.config
So that the db’s connection string is hidden? I remember that it is
possible to encrypt Web.config for asp.net. Maybe something similar is
possible?
Any feedback would be very much appreciated. Many thanks in advance.
You would need to configure the connection string property in code to decrypt, SharpArch provides following overload which allows adding properties to your config:
Where the decrypt method DecryptConnectionString() gets the connection string from wherever you like, be it an encrypted config section from app.config or hard coded string.
As Corbin said, this makes it more complicated for average Joe to figure out the connection string, but it can be done, if you are going to be distributing this then I would look into not connecting to the db directly.
Look into ILMerge if you want 1 executable with dlls inside it.