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

  • Home
  • SEARCH
  • 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 9004877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:00:00+00:00 2026-06-16T01:00:00+00:00

I am writing a compiler for a language that runs on the .NET framework.

  • 0

I am writing a compiler for a language that runs on the .NET framework. I’m trying to generate code for an import statement. Basically

import System.Drawing

Should behave like

using System.Drawing;

in C#. The import statement will also support things like:

import Foo.Bar in "foo.dll"

Which will import the Foo.Bar class in foo.dll. My question is how would I go about linking these into my generated program using Reflection.Emit?

Thank you.

  • 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-16T01:00:01+00:00Added an answer on June 16, 2026 at 1:00 am

    You just: consume the library. Meaning, you just use types / methods from foo.dll in your emitted code. The Reflection.Emit wrapper will add the necessary reference metadata automatically. Note that this means that if your code imports a library and then doesn’t use it, then that reference will not exist in the generated IL. Which funnily enough is exactly what the C# compiler does too (and probably the VB one).

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

Sidebar

Related Questions

I'm writing some optimized C code that basically runs through an array and does
I'm working on writing a compiler for a language running on .net and one
I am writing a LLVM code generator for the language Timber, the current compiler
I've heard of the idea of bootstrapping a language, that is, writing a compiler/interpreter
I'm currently writing a compiler for a small language that compiles to JavaScript. In
I am writing a compiler for an assignment for a language that has empty
I'm writing a compiler project which will produce assembly code as the target language.
I'm writing a compiler which uses C as an intermediate code which is (Currently)
I am experimenting with writing a toy compiler in ocaml. Currently, I am trying
I am writing a compiler for a subset of the Java language and during

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.