Jump to content

Reference preloaded dependent dll's


DaveB

Recommended Posts

I am building a .NET app for ACAD 2024 and have a question about dependent DLLs. In the Initialize method of my IExtensionApplication app I have this...

        public void Initialize()
        {
            var editor = AcadLib.Instance.Editor;
            editor.WriteMessage("\nLoading SuperDuperApp v2024.2... ");

            try
            {
                var executingAssemblyLocation = Assembly.GetExecutingAssembly().Location;
                var baseDirectory = Path.GetDirectoryName(executingAssemblyLocation);
                editor.WriteMessage("\nSuperDuperApp Support Assemblies... ");
                // support assemblies
                TryToLoadAssembly($"{baseDirectory}\\Csv.dll");
                TryToLoadAssembly($"{baseDirectory}\\CommonServiceLocator.dll");

This way I should only need to load the top level DLL (automatically, or otherwise) and everything dependent loads during initialization. This is a WPF app living in a palette set and using MVVM. I am using the older Galasoft MVVMLight library because I've found ACAD really doesn't like the newer community version. Too bad.

That CommonServiceLocator is being a problem though. If I don't have the directory with my app in it in the support file search path, ACAD complains that my ViewModelLocator class can't find the CommonServiceLocator, despite it being pre-loaded into the .NET sandbox. Is there a way to specify a search location or should I just let everything load on demand by going through the support search path?

Edited by DaveB
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...