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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:27:12+00:00 2026-06-08T20:27:12+00:00

I have one assembly that’s created already, say Static.dll , and a dynamic assembly

  • 0

I have one assembly that’s created already, say Static.dll, and a dynamic assembly I’m creating at runtime, say Dynamic. Dynamic creates some IL code to create a new type from Static.dll. When Dynamic is created (it saves successfully), the executable, when ran, errors out because it’s unable to load the assembly Static.dll type. I believe this is happening since the Dynamic exe output can’t find this dll (or at least this is my guess).

How can accomplish adding in this Static.dll reference so that when someone runs the resulting executable output of Dynamic that it can find the referenced types?

I know about Assembly.Load(), but this alone doesn’t change anything. Or at least, I’m not sure what this gives me since I don’t need to use the type at runtime, but rather when running the Dynamic executable.

Lastly, I control the Static.dll, so if there is something I can do with the project to fix it, It could be done, however, it does need to remain separate (I don’t want to Emit this library for every time I create a dynamic assembly). Basically, I think I want to have my dynamic assembly to have a .assembly extern mscorlib in it’s manifest save Static is place of the mscorlib.

Thanks

  • 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-06-08T20:27:14+00:00Added an answer on June 8, 2026 at 8:27 pm

    How can accomplish adding in this Static.dll reference so that when someone runs the resulting executable output of Dynamic that it can find the referenced types?

    The reference will be added automatically. Note that normal assembly-probing rules apply when your dynamic assembly executes, so in order to find the assembly. You must (one of):

    • ship static.dll alongside dynamic.dll
    • put static.dll in the GAC (but please: don’t do this!)
    • run dynamic.dll in a custom AppDomain with a custom probing-path configuration that lets static.dll be found
    • handle AppDomain.AssemblyResolve to provide static.dll
    • use something like ILMerge to fuse static.dll and dynamic.dll
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a window in one assembly that has a TextBlock control that I
I used to think that an assembly could have only one main() method until
I have ILMerged some assemblies. For example: Foo.Bar Bar.Foo Foo.Baz Into one assembly. For
I have a project that uses System.Runtime.Serialization assembly. I am using the type DataContractSerializer
In one of projects I have a file written in ARM assembly that uses
My solution is primarily C#, but I have one C++ project that creates a
I have an assembly that may be used by more than one process at
I have all my NHibernate in one assembly and that assembly gets loaded into
I have two references to a SQLite assembly, one for 32-bit and one for
have one time consuming step that flattens a bunch of files. basically i'd like

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.