Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7678989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:46:23+00:00 2026-05-31T17:46:23+00:00

I have written a little console application that uses s#arp. I can create an

  • 0

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:

SO link

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T17:46:25+00:00Added an answer on May 31, 2026 at 5:46 pm

    You would need to configure the connection string property in code to decrypt, SharpArch provides following overload which allows adding properties to your config:

    NHibernateSession.Init(
                    sessionStorage,
                    new[] { Server.MapPath("~/bin/Suteki.TardisBank.Infrastructure.dll") },
                    new AutoPersistenceModelGenerator().Generate(),
                    Server.MapPath("~/NHibernate.config"),
    
                    // You can get all the values from your config and use here,
                    // if you dont want a config file at all, or just decrypt the 
                    // connection string and provide that value dictionary:
                    new System.Collections.Generic.Dictionary<string, string>
                        {
                            {
                                NHibernate.Cfg.Environment.ConnectionString, DecryptConnectionString()
                            }
                        }, null);
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a little python application and here you can see how Task
I have written a little program that deletes a record from the database using
I am learning flex and have written a little app with a TextArea that
I'm using P4COM to communicate with our perforce server. I have written an little
Just wondering what little scripts/programs people here have written that helps one with his
I am adapting a little rmi client-server application. I have written several things :
I have a little game written in C#. It uses a database as back-end.
I have a little logging app (written in wxPython) that receives data from a
I have a little facebook iframe application written with rails and the facebooker plugin.
I have a little routine that's run under Linux and Windows written in C

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.