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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:01:41+00:00 2026-05-25T20:01:41+00:00

I have two dll files in the project tree(not the references). They are added

  • 0

I have two dll files in the project tree(not the references). They are added as link, they are assemblies of other project in solution. I’m trying to set their Build Action to Embedded Resource, so I can import them to .exe file. I can’t write using statement, so I can’t reference them in current project. How can that be done?

project file

  • 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-25T20:01:42+00:00Added an answer on May 25, 2026 at 8:01 pm

    You need to add a hard reference to the assemblies and set their Copy Local to False, then extract the assemblies from your embedded resources to the application directory before they are invoked. You can’t reference a linked (shortcut) like you want.

    Key Points (in this example) and the Blog Article with Example Code

    • EmbeddedReferenceApplication hard references EmbeddedReference.dll
    • EmbeddedReference reference property Copy Local is set to False
    • Linked assembly (Add as Link) is set as Embedded Resource

    Here is a working example. (EmbeddedReferenceApplication.exe | Console Application)

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.IO;
    using System.Windows.Forms;
    using System.Reflection;
    using EmbeddedReference; // Hard reference with Copy Local = False
    
    namespace EmbeddedReferenceApplication {
        class Program {
            static void Main(string[] args) {
                AppDomain.CurrentDomain.AssemblyResolve += AppDomain_AssemblyResolve;
                MyMain();
            }
    
            private static void MyMain() {
                EmbeddedReference.MessageHelper.ShowMessage();
            }
    
            private static Assembly AppDomain_AssemblyResolve(object sender, ResolveEventArgs args) {
                string manifestResourceName = "EmbeddedReferenceApplication.EmbeddedReference.dll"; // You can also do Assembly.GetExecutingAssembly().GetManifestResourceNames();
                string path = Path.Combine(Application.StartupPath, manifestResourceName.Replace("EmbeddedReferenceApplication.", ""));
                ExtractEmbeddedAssembly(manifestResourceName, path);
                Assembly resolvedAssembly = Assembly.LoadFile(path);
                return resolvedAssembly;
            }
    
            private static void ExtractEmbeddedAssembly(string manifestResourceName, string path) {
                Assembly assembly = Assembly.GetExecutingAssembly();
                using (Stream stream = assembly.GetManifestResourceStream(manifestResourceName)) {
                    byte[] buffer = new byte[stream.Length];
                    stream.Read(buffer, 0, buffer.Length);
                    using (FileStream fstream = new FileStream(path, FileMode.Create)) {
                        fstream.Write(buffer, 0, buffer.Length);
                    }
                }
            }
        }
    }
    

    In EmbeddedReference.dll

    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace EmbeddedReference {
        public static class MessageHelper {
            public static void ShowMessage() {
                Console.WriteLine("Hello World!");
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two project in my solution: C/C++ Win32 DLL and some C# application.
I have two DLL files that have the same namespace but they have different
I have this c# web app that relies heavily on two dll files that
I have two WIN32 DLL projects in the solution, main.dll should call a function
I have two projects, one project loads files from the project folder, one project
I have a project that uses the serial port, and it requires two files
I have two vc++ dll projects, which will generate two dlls. A vector<vector<string>> object
I have two class libraries MyLibrary.dll and MyLibraryEditor.dll for a Unity runtime and editor
An application I have recently started work on has to register two dll's, because
Have two folders with approx. 150 java property files. In a shell script, how

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.