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 700899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:32:58+00:00 2026-05-14T03:32:58+00:00

First I will try to explain what I want to do. The app loads

  • 0

First I will try to explain what I want to do.

The app loads a NhHibernate config file and parse the xml, allowing changes to the connection string and the mapping assembly.

The problem is that when I run the app in the directory that contains NHibernate.dll and all references, it works well, but if I run the app from other directory, the Configure() fails.

This is the code I have:

        Configuration cfg = new Configuration();
        cfg.Properties = props; // the properties are OK
        cfg.AddAssembly(Assembly.LoadFrom(filename)); // <- this line fails

When I debugged NHibernate, it failed in this method in class NHibernate.Util.ReflectUtil:

public static System.Type TypeFromAssembly(AssemblyQualifiedTypeName name, bool throwOnError) 
.
.
Assembly assembly = Assembly.Load(name.Assembly); // line 265
.
.

That method search for the assembly in the current domain, but the assembly is located in other directory.

The purpose of the app is to replicate in different development and test environments little changes made to the entities. I don’t want the others developers copy this app to their projects, I want that they select the correct project directory in the app, then the app will configure NHibernate, and if requested by the user, it will execute the updates to their DB.

I tried loading/executing the app in a different AppDomain but with no success.

Maybe this is not possible? or I’m missing something.
Some advise please, I’m stuck with this problem.

PD: Sorry for my English, correct the question if necessary.

  • 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-14T03:32:59+00:00Added an answer on May 14, 2026 at 3:32 am

    If the required assemblies are in a non-standard directory, you will need to help the CLR find them. There are a number of ways to do this:

    1. Via a probing element in configuration.
    2. Via AppendPrivatePath in a custom AppDomain.
    3. Via the AssemblyResolve event of any AppDomain.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will try and explain exactly what I want to achieve first. Imagine two
I want to create a web app that will use wicket, hibernate and spring
i will try to explain the problem very clear. I user MicroSoftReportViewer where i
I will try to explain as well as possible what I'm trying to do.
sorry for asking this dumb question i will try to explain as good as
This is a bit tricky to explain but I will try my best to
Which command will executed first,If a stored procedure have individual multiple select commands;
I am writing my first project that will use autoconf and teaching it to
For example, will the first piece of code perform a full search twice, or
With :limit in query, I will get first N records. What is the easiest

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.