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

Problem loading .net DLL

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
974 Views, 9 Replies

Problem loading .net DLL

Hi Everyone...

I'm having a problem loading .net DLLs from the network or C:\. The DLLs work when loaded from bin\Release\, but when I copy the DLL to network or C: or other folder it's not working.

I have tried also from the registry and Neither works... only works from bin\Release\

Thanks for your time...
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous


1. Make sure you do not copy referenced AutoCAD
managed DLL files (acdbmgd.dll/acmgd.dll and other if you use Acad vertical
product) to the folder where your application DLL loads from. That is, for each
of those referenced DLL, you make sure set its "Copy to Local" to
"False";

 

2. If you copy your application DLL to a network
drive/share, you MUST configure .NET Framework's CAS (Code Access Security) of
the running computer, or the .NET code (your app DLL) will not load due to
security reason.

 

3. There is no reason your app DLL won't run when
loading from C:\ (loaded by "NETLOAD" command), as long as 1 is done, unless
your code need to write data to the folder while the user may not have
permission to write to.

 

4. If you use settings stored on app.config, you
have to move the settings into acad.exe.config, which is in Acad installation
folder.

 

5. You'd better be more specific than just saying
"I'm having problem loading...". What is the problem? any error
message?

 

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
Everyone... I'm having a problem loading .net DLLs from the network or C:\.
The DLLs work when loaded from bin\Release\, but when I copy the DLL to
network or C: or other folder it's not working. I have tried also from the
registry and Neither works... only works from bin\Release\ Thanks for your
time...
Message 3 of 10
Anonymous
in reply to: Anonymous

Hi Master...

1.- Yes, the AutoCAD's references (acdbmgd.dll and acmgd.dll) they are like "Copy to Local" to False. But I have a reference to ADOX.dll and this reference it is like "Copy to Local" to True, because if I do not does not create a database (*.mdb) even load it from the bin\Release\ folder.

2.- I have all the permits and this problem happens in C: or in other folders. I get the same problem in other folders.

3.- I don't know that happend, but even I load it from C: this gives me the problem.

4.- I did not understand this point

5.- In summary the problem is that the dll does not work well when I load it from another folder, does not generate a *.mdb file, simply that activate a timer but no more. Is as if the dll it did nothing, not running from anything AutoCAD.

This will not send any error message... 😞

Thanks you Norman...
Message 4 of 10
Anonymous
in reply to: Anonymous



So, you use COM interop of MS ADO Extension. In
this case, when you set refernce to "MS ADO Ext. 2.x for DDL and Security", VS
generates "interop.ADOX.dll". And yes, its "Copy to Local" should be
true.

 

When you load your DLL from any folder other than
"...bin\release", did you place "interop.adox.dll" in the same folder (you did
not mention it)?


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
Master... 1.- Yes, the AutoCAD's references (acdbmgd.dll and acmgd.dll) they
are like "Copy to Local" to False. But I have a reference to ADOX.dll and this
reference it is like "Copy to Local" to True, because if I do not does not
create a database (*.mdb) even load it from the bin\Release\ folder. 2.- I
have all the permits and this problem happens in C: or in other folders. I get
the same problem in other folders. 3.- I don't know that happend, but even I
load it from C: this gives me the problem. 4.- I did not understand this point
5.- In summary the problem is that the dll does not work well when I load it
from another folder, does not generate a *.mdb file, simply that activate a
timer but no more. Is as if the dll it did nothing, not running from anything
AutoCAD. This will not send any error message... 😞 Thanks you
Norman...
Message 5 of 10
Anonymous
in reply to: Anonymous

Norman...

Now It is working, I copy the two files DLLs, one the file that I load it with NETLOAD and interop.ADOX.dll, this works in any folder but this not works from network, I think the problem is the Code Access Security (CAS) as you mentioned it. My problem is that I don't know like do it to fix it. You have some example code in Visual .NET please...

Thanks you Norman...
Message 6 of 10
Anonymous
in reply to: Anonymous


To configure CAS, you use CASPOL.exe (which you can
find in "C:\Windows\Microsoft.NET\Framework\v2.0.50727". Search MSDN or google
the net for "CASPOL.EXE", you will get tons of articles on how to use
it.

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Norman...
Now It is working, I copy the two files DLLs, one the file that I load it with
NETLOAD and interop.ADOX.dll, this works in any folder but this not works from
network, I think the problem is the Code Access Security (CAS) as you
mentioned it. My problem is that I don't know like do it to fix it. You have
some example code in Visual .NET please... Thanks you
Norman...
Message 7 of 10
Anonymous
in reply to: Anonymous

i would like to complete the information as a "thank you", because this hint helped me very much

the caspol use with parameters should look like this:

for XP 32-bit: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -m -ag 1.2 -url file://\\PathToNetworkShare/* FullTrust
for Windows 7 32-bit: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -m -ag 1.3 -url file://\\PathToNetworkShare/* FullTrust
for Windows 7 64-bit: C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\CasPol.exe -m -ag 1.3 -url file://\\PathToNetworkShare/* FullTrust

from what i've read, but was not able to test (as we have no Vista machines), Vista behaves like XP (intranet is understood as intranet, Windows 7 treats intranet as internet, that's why you have to use the code group 1.3)

credits: AJAAC on msdn forum and shawnfa on msdn blog
Message 8 of 10
Anonymous
in reply to: Anonymous

just a note: if you are using 64-bit operating system with 32-bit AutoCAD application, you have to set the policy for 32-bit version of .NET
Message 9 of 10
Anonymous
in reply to: Anonymous

Just note that the Autodesk new server may have mangled
this post, so what you see in a broswer may not be correct.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2011

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6372808@discussion.autodesk.com...
i would like to complete the information as a "thank you", because this hint
helped me very much

the caspol use with parameters should look like this:

for XP 32-bit: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -m -ag
1.2 -url file://\\PathToNetworkShare/* FullTrust
for Windows 7 32-bit:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CasPol.exe -m -ag 1.3 -url
file://\\PathToNetworkShare/* FullTrust
for Windows 7 64-bit:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\CasPol.exe -m -ag 1.3 -url
file://\\PathToNetworkShare/* FullTrust

from what i've read, but was not able to test (as we have no Vista machines),
Vista behaves like XP (intranet is understood as intranet, Windows 7 treats
intranet as internet, that's why you have to use the code group 1.3)

credits: AJAAC on msdn forum and shawnfa on msdn blog
Message 10 of 10
Anonymous
in reply to: Anonymous

i'm using Opera and i see it correctly, i also copy+pasted it to command line and it works, not sure how it is for other browsers

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