.NET

Reply
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 21 of 25 (226 Views)

Re: netload does not load dll

06-18-2012 08:53 PM in reply to: PencilsWereSoEasy

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()
  {
  }
} 

 

Distinguished Contributor
eljobe
Posts: 704
Registered: ‎01-24-2003
Message 22 of 25 (216 Views)

Re: netload does not load dll

06-19-2012 07:22 AM 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.

Valued Contributor
PencilsWereSoEasy
Posts: 55
Registered: ‎05-07-2012
Message 23 of 25 (211 Views)

Re: netload does not load dll

06-19-2012 08:15 AM in reply to: eljobe

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"
Valued Contributor
PencilsWereSoEasy
Posts: 55
Registered: ‎05-07-2012
Message 24 of 25 (208 Views)

Re: netload does not load dll

06-19-2012 08:35 AM in reply to: PencilsWereSoEasy

here's the code for the main problem dll


______________________________
~ "if this were /. this would be funny"
Valued Mentor
jeff
Posts: 322
Registered: ‎05-12-2009
Message 25 of 25 (193 Views)

Re: netload does not load dll

06-19-2012 04:29 PM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community