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

The Archive Base Latest Questions

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

I would like to embed depencency dll into my HttpHandler dll for easier deployment,

  • 0

I would like to embed depencency dll into my HttpHandler dll for easier deployment, so I was thinking to add it to solution as embedded resource and use AppDomain.CurrentDomain.AssemblyResolve event to resolve it.
Problem is, that if I subscribe to event in void ProcessRequest(HttpContext context) method, looks like it fails to resolve before it reaches event subscription.
So question would be where should I subscribe to that event, to be able to load dll from embedded resource.

  • 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-28T17:37:32+00:00Added an answer on May 28, 2026 at 5:37 pm

    You could use the static constructor of your handler. For example:

    public class Handler1: IHttpHandler
    {
        static Handler1()
        {
            AppDomain.CurrentDomain.AssemblyResolve += (sender, e) =>
            {
                if (string.Equals(e.Name, "ClassLibrary1", StringComparison.OrdinalIgnoreCase))
                {
                    using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Handler.ClassLibrary1.dll"))
                    {
                        var buffer = new byte[stream.Length];
                        stream.Read(buffer, 0, buffer.Length);
                        return Assembly.Load(buffer);
                    }
                }
                return null;
            };
        }
    
        public void ProcessRequest(HttpContext context)
        {
            var mtd = Type.GetType("ClassLibrary1.Class1, ClassLibrary1").GetMethod("Hello", BindingFlags.Static | BindingFlags.Public);
            var result = (string)mtd.Invoke(null, null);
            context.Response.ContentType = "text/plain";
            context.Response.Write(result);
        }
    
        public bool IsReusable
        {
            get { return true; }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to embed the great Bottle web framework into a small application
I would like to embed a flash file into my facebook iframe canvas, I
I would like to embed Clojure code into Java. This site was helpful in
I would like to embed the FontDialog control into a settings dialog box for
I'm would like to embed Internet Explorer into an WPF Windows Application. I have
I would like to embed a Python interpreter into my .NET application. I'm aware
I would like to embed Jetty into my application. Is the maven artifact jboss-jetty?
I would like to embed mozilla firefox into my application WITHOUT using any activex
I have a website that I would like to embed a blog into. I
I would like to embed an image into my JasperReports jrxml file. I have

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.