.NET

Reply
Valued Contributor
PencilsWereSoEasy
Posts: 55
Registered: ‎05-07-2012
Message 1 of 25 (577 Views)

netload does not load dll

577 Views, 24 Replies
06-15-2012 06:30 AM

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"
Valued Mentor
gasty1001
Posts: 444
Registered: ‎04-11-2010
Message 2 of 25 (573 Views)

Re: netload does not load dll

06-15-2012 06:44 AM in reply to: PencilsWereSoEasy

Hi,

 

Di you set up acad.config to work with 4.0 in that machine? Is .NET 4.0 Framework installed in that machine?, 32/64 bit issues, etc etc.

Also try posting the error message if any.

 

Gaston Nunez

 

 

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

Re: netload does not load dll

06-15-2012 09:01 AM in reply to: gasty1001

4.0 is installed, i have not edited the config file, but i also haven't edited on any of the other 60 boxes that seem to be working fine.


______________________________
~ "if this were /. this would be funny"
Distinguished Contributor
eljobe
Posts: 704
Registered: ‎01-24-2003
Message 4 of 25 (558 Views)

Re: netload does not load dll

06-15-2012 09:15 AM in reply to: PencilsWereSoEasy

I had an issue like that. There is some resource, etc. that that machine is lacking that causes a failure (unhandled exception) in your code and thus it won't load. Since  you don't have VS on that pc to do debugging, what I did was create some temp debugging statements in the dll that printed status messages to the editor at key points in the code. e.g. "Stage 1 passed". That helps narrow down where in your code the error is occurring. You could also include something similar in your Try..Catch statements. If you are not using Try..Catch, you could be getting errors and not knowing it. In my case, I still had some legacy vba stuff that I was loading at startup and on some pc's, the vba enabler never got installed.

 

Also, since the dll is loading on an event, it behaves a little differently than manually loading it. When you manually load it, the event is not firing, thus your code doesn't execute. So the dll could be loading but not executing. You could also create a command that runs the delegate that the event calls. That way you could test it manually.

Distinguished Contributor
mohnston
Posts: 184
Registered: ‎09-22-2006
Message 5 of 25 (555 Views)

Re: netload does not load dll

06-15-2012 09:20 AM in reply to: PencilsWereSoEasy

Just guessing here but could it be a security issue?

 

Any chance dll was downloaded to computer? Maybe needs "Unblock"?

 

If Windows 7 machine could UAC be set too high?

 

CAD Programming Solutions
Valued Contributor
PencilsWereSoEasy
Posts: 55
Registered: ‎05-07-2012
Message 6 of 25 (547 Views)

Re: netload does not load dll

06-15-2012 10:33 AM in reply to: mohnston

we're still on XP (no UAC) and because i tried two different windows profiles (the user and an admin) i assume any security setting issues would have presented themselves.  The IE settings on in the admin profile are the OOTB settings.


______________________________
~ "if this were /. this would be funny"
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 7 of 25 (531 Views)

Re: netload does not load dll

06-15-2012 05:55 PM in reply to: eljobe

Also, since the dll is loading on an event, it behaves a little differently than manually loading it. When you manually load it, the event is not firing, thus your code doesn't execute. So the dll could be loading but not executing. You could also create a command that runs the delegate that the event calls. That way you could test it manually.


Hi.  What you say above does not appear to be the case here. Would you care to explain further what 'event' managed assemblies are loaded on?  

 

As far as I know, there is no difference in the behavior of a managed assembly regardless of how it is loaded. The IExtensionApplication.Initialize() method will always execute regardless of how a managed extension dll is loaded.

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

Re: netload does not load dll

06-18-2012 08:11 AM in reply to: DiningPhilosopher

Kelvin,

 

Thanks for requesting clarification. So when I said "it behaves", I didn't mean the dll load process, but code execution. My first suggestion addressed the possiblity that a runtime error in the Initialize method prevented the dll from loading. The second suggestion addressed the the possiblity that the dll did load, but without any observable effect.

 

Since the OP didn't post any code, I have to make some assumptions. Yes, the code in the Initialize method would run, but I don't know what that might be, if any. This is the statement I was addressing:


PencilsWereSoEasy wrote:

even explicitly issuing the netload command and grabbing the dll manually does not work.

 It sounded like he expected the code that runs in the dwg open event, to work when he netloaded it. So I was pointing out that the open event would not fire at that point. Therefore, it may only appear that the dll didn't load successfully. To test the code that runs in an event, he could create a command method that calls it, provided that any requirements that the code needs to run are met. Looking back, I also see I may not have understood one part. It appears that the problem dll is possibly being called from another dll during the dwg open event. That doesn't necissarly imply that any other action is happening upon dwg open. So we really have no clear idea what's going on until they provide more details. Until then, everybody's just throwing out ideas.

 

Thanks again.

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

Re: netload does not load dll

06-18-2012 08:57 AM in reply to: eljobe

and then just for MY clarification (since i have no coding knowledge, other than minor LISP) i'm assuming that just manually issuing NETLOAD and reaching for the dll file should work.  am i correct on that?  that process works on every other machine except the porblem one, and it also seems to work with my acaddoc.lsp file doing the net-loading.


______________________________
~ "if this were /. this would be funny"
Distinguished Contributor
eljobe
Posts: 704
Registered: ‎01-24-2003
Message 10 of 25 (490 Views)

Re: netload does not load dll

06-18-2012 09:31 AM in reply to: PencilsWereSoEasy

When you say, "it works"or "it doesn't work", we have no idea what that means. Think "here's what I think should happen" and "here's what actually happens" and then provide the details. Yes you can netload the dll, but what do you expect to happen after netload finishes? (note the side discussion on whether you have code in the Initialze method). If it loaded successfully, you should be able to see its commands listed if you run "ARX C". If not, you need to find ways to debug your code. If you can't run VS on the problem pc to do an actual debugging session, then you can code in some "progress markers" or other indicators of code execution. Even using a messagebox here and there works to display some status info.

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