Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP forum
Answered

Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

Posted on by 5

I have a C# application where we use eConnect to pull and push data into Great Plains.  Recently we have experienced the error above.  I have checked that eConnect is running and we can call to connect and close the connection from the program.  I have stepped through the code and the issue occurs when I call the form show event.   It is saying that the file is not found, I have tried moving the file to the project and changing the reference to it, did not work, changed copy local value from True to False and that has no effect.  

System.IO.FileNotFoundException
  HResult=0x8007007E
  Message=Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found.
  Source=AHHGPCapitated
  StackTrace:
   at AHH.GreatPlainsExtension.frmCapitated.frmCapitated_Load(Object sender, EventArgs e) in H:\WorkSpace\GreatPlains\GP2015\Extensions\AHHGPCapitated\frmCapitated.cs:line 50
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at Microsoft.Dexterity.Shell.DexBaseForm.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    Thanks for updating us, its nice to hear the outcomes!

    Tim.

  • Verified answer
    Keith Claypool Profile Picture
    Keith Claypool 5 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    I wanted to post back what I found, looks like the error is not the 'real' error.  It was trying to make an updated to the data but the check that it was doing before the 'error' was while (i < TotalRecords2Process & !eConnectProcess.HasExited)  This is a Bitwise operator not a TRUE AND I changed this to while (i < TotalRecords2Process && !eConnectProcess.HasExited) and the code flowed as it was attended to rather than hitting the  logging catch that needed the connection that was not open do to the failing the check above.

    hope this helps someone  :)

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    Be paranoid about showing/ interacting with UI on any thread but the UI thread....

    GP will kick you hard if you don't (not clear if this is running as addin from GP or not), threading rules still apply though.

    I say that without really looking deeply at the code or having the whole object model, but notice datePickerInvoiceDate.Value being referenced inside the background worker, that is not UI thread (for example). It should be passed into the background worker as a parameter value.

    Also Form.OnLoad(EventArgs e) sounds like a windows form opening, is this happening in here, if so it should be marshalled back to the UI thread.

    Don't know if this be your issue, as I can't picture what is created where etc from the snippet,  but worth checking your threading over.

    Tim

  • Keith Claypool Profile Picture
    Keith Claypool 5 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    will do, thanks for the help and I will post back what I find  :)

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    I am wondering if the error message you are receiving is leading you down the proverbial yellow brick road. I would try inserting a few more try-catch statements to see if you get a more useful message. Then insert a few breakpoints a run debug by attaching to DYNAMICS.EXE as you execute the code.

  • Keith Claypool Profile Picture
    Keith Claypool 5 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    here is where the 'work' is done and where I believe the error is coming from

    void capBackgroundWorker_DoWork(object sender, DoWorkEventArgs e)

           {

               try

               {

                   int i = 0;

                   string eConnectDBString = GPUser.eConnectConnectionString.ToString();

                   string gpConnectDBString = GPUser.GPDBConnectionString.ToString();

                   BackgroundWorker backgroundWorker = sender as BackgroundWorker;

                   // build the string to pass to the app

                   StringBuilder sbAppArgs = new StringBuilder();

                   sbAppArgs.Append(@"""" + Helpers.GetConfigurationValue(Assembly.GetExecutingAssembly().Location, "ObjectFactory") + @""" ");

                   sbAppArgs.Append(@"""" + datePickerInvoiceDate.Value.ToShortDateString() + @""" ");

                   sbAppArgs.Append(@"""" + eConnectDBString + @""" ");

                   sbAppArgs.Append(@"""" + gpConnectDBString + @""" ");

                   sbAppArgs.Append(@"""" + GPUser.DSNName + @""" ");

                   sbAppArgs.Append(@"""" + GPUser.UserId + @""" ");

                   string LoggingArgs = sbAppArgs.ToString();

                   sbAppArgs.Append(@"""" + GPUser.UserPassword + @"""");

                   // get record count for initial

                    Capitated capitated = new Capitated();

                   ICollection<ICapitatedInvoice> capitatedInvoices = capitated.RunCapitated(datePickerInvoiceDate.Value);

                   TotalRecords2Process = capitated.TotalRecords;

                   // execute econnect

                   string eConnectPath = Assembly.GetExecutingAssembly().Location.Replace(Assembly.GetExecutingAssembly().ManifestModule.Name, Helpers.GetConfigurationValue(Assembly.GetExecutingAssembly().Location, "CapitatedExe"));

                   //System.Threading.Thread.Sleep(4);

                   using (Process eConnectProcess = new Process())

                   {

                       eConnectProcess.EnableRaisingEvents = true;

                       ProcessStartInfo startInfo = new ProcessStartInfo();

                       startInfo.FileName = eConnectPath;

                       startInfo.WindowStyle = ProcessWindowStyle.Hidden;

                       startInfo.UseShellExecute = false;

                       startInfo.RedirectStandardOutput = true;

                       startInfo.Arguments = sbAppArgs.ToString();

                       eConnectProcess.StartInfo = startInfo;

                       eConnectProcess.Start();

                       if (!eConnectProcess.HasExited)

                       {

                           eConnectProcessID = eConnectProcess.Id;

                           while (i < TotalRecords2Process & !eConnectProcess.HasExited)

                           {

                               RecordsProcessed = capitated.GetCapitatedProgress(datePickerInvoiceDate.Value, StartRunDateTime);

                               i = RecordsProcessed;

                               double percentage = Convert.ToDouble(i) / Convert.ToDouble(TotalRecords2Process) * 100;

                               backgroundWorker.ReportProgress((int)percentage);

                               if (TotalRecords2Process <= 100)

                               {

                                   System.Threading.Thread.Sleep(500);

                               }

                               else

                               {

                                   System.Threading.Thread.Sleep(5000);

                               }

                               if (backgroundWorker.CancellationPending == true)

                               {

                                   e.Cancel = true;

                                   KilleConnectProcess();

                                   break;

                               }

                           }

                       }

                       using (StreamReader reader = eConnectProcess.StandardOutput)

                       {

                           string result = reader.ReadToEnd();

                           if (result.Contains("ERROR"))

                           {

                               AHHAdapter.LogError(LoggingArgs, result, LogPacket);

                           }

                       }

                       eConnectProcess.WaitForExit();

                   }

               }

               catch (Exception ex)

               {

                   AHHAdapter.LogError("Error", ex.Message + "," + ex.StackTrace, LogPacket);

               }

           }

  • Keith Claypool Profile Picture
    Keith Claypool 5 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    public partial class frmCapitated : DexUIForm

       {

           private BackgroundWorker capBackgroundWorker = new BackgroundWorker();

  • Keith Claypool Profile Picture
    Keith Claypool 5 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    here is the button click event.  I sure that you need the more details than this

    private void btnRunCapitated_Click(object sender, EventArgs e)

           {

               StartRunDateTime = DateTime.Now;

               lblProgress.Text = "Retrieving Data";

               AHHAdapter.LogInfo("Capitated Processing", "Started", LogPacket);

               if (capBackgroundWorker.IsBusy != true)

               {

                   capBackgroundWorker.RunWorkerAsync();

                   btnRunCapitated.Enabled = false;

                   btnCancel.Enabled = true;

               }

           }

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    Then it must something in your environment.  I have dozens of workstations and servers that serve as development and workstation computers and I have never seen this. We have used Sophos and Trend Micro for anti-virus. If you click on Properties for Microsoft.Dexterity.Bridge.dll and then details what is the product version?

    H:\WorkSpace\GreatPlains\GP2015\Extensions\AHHGPCapitated\frmCapitated.cs:line can you show us what exactly what is throwing this error?

  • Keith Claypool Profile Picture
    Keith Claypool 5 on at
    RE: Could not load file or assembly 'Microsoft.Dexterity.Bridge.dll' or one of its dependencies. The specified module could not be found

    the servers are Windows 2012 currently and up to date on all Microsoft patches.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans