.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

netload does not load dll

25 REPLIES 25
Reply
Message 1 of 26
PencilsWereSoEasy
4726 Views, 25 Replies

netload does not load dll

I've read through a number of threads on this, but they all seem to go after the code which i don't think applies to me.

 

I've got a firm of about 60 architects and we use a custom dll that loads on drawing open.  the dll loads fine on all but one computer.  even explicitly issuing the netload command and grabbing the dll manually does not work.  it also does not work on other profiles on that computer (i tried an admin profile, even though the user is a local admin).

 

so it seems there's some kind of environmental setting somewhere that i'm missing.

 

any thoughts?

 

we're using .NET 4.0 on ACAD 2011

 


______________________________
~ "if this were /. this would be funny"
25 REPLIES 25
Message 21 of 26

The problem you're having has something to do with code that runs when the DLL loads, and the only place where code can run when a DLL loads is the IExtensionApplication.Initialize() method. My guess is the code is dependent on something that is not present or not up-to-date on the problem machine. 

 

So, you should tell the programmer to place all of that code inside of a try/catch and in the catch block, show a message on the AutoCAD command line.

 

Here is what we do:

 

public class MyApplication: IExtensionApplication
{
  public void Initialize()
  {
    try
    {
       // place all initialization code here
    }
    catch(System.Exception ex)
    {
      Application.DocumentManager.MdiActiveDocument
          .Editor.WriteMessage(ex.ToString());
    }
  }
  public void Terminate()
  {
  }
} 

 

Message 22 of 26
Ed.Jobe
in reply to: DiningPhilosopher


@DiningPhilosopher wrote:

 I was asking you what 'event' the DLL is loading on, and why it would behave differently (loading or code execution, it does not matter which) if it is loading on 'event' verses being loaded manually via NETLOAD.

 



Let me put it another way. Disregard that phrase.

 

The OP said that the dll loaded when a dwg was opened. That led me to believe that the dll ran some code within the open event. I may be wrong on that point, but what I was trying to point out was that if there was, it would not run when they netloaded it, because a dwg was not opening at that moment, and that might be the reason "it didn't work". IOW, you don't always have code in the plugin's Initialze event.

Ed

EESignature

Message 23 of 26
PencilsWereSoEasy
in reply to: Ed.Jobe

pretty convinced it's a wonky security setting somewhere.  just spend a good bit with the programmer trying to isolate ... anything, really.

 

he wrote a simple dll that just pops a form on the screen and that worked, if we reset the cad profile.  then we noticed that other dlls did not work on the network, but did work if we ran them locally.  the kicker is that we also found the opposite to work with other dlls.  so it seems to be bit and pieces here and there.

 

some of them would load, but with this kind of stuff:

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

 

so, its might be something in the code, but since it's working on everyone else's standard box, i'm just gonna reimage his (mainly because this is legacy stuff from a 15 year old dvb (that we flipped to .net) and we're building a whole new standalone app to replace it).

 

i appreciate everyone's help here and i'll post any new developments.  gotta move on to current work regular work.


______________________________
~ "if this were /. this would be funny"
Message 24 of 26

here's the code for the main problem dll


______________________________
~ "if this were /. this would be funny"
Message 25 of 26
jeff
in reply to: PencilsWereSoEasy

Loading your dll from a network is most likely your problem

http://through-the-interface.typepad.com/through_the_interface/2011/07/loading-blocked-and-network-h...

You can also find your answers @ TheSwamp
Message 26 of 26

Was there ever a resolution to this thread? 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost