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

Can I Netload 4.5 dll into autocad 2012

5 REPLIES 5
Reply
Message 1 of 6
RamanSBV
1343 Views, 5 Replies

Can I Netload 4.5 dll into autocad 2012

Hi,

 

 

Please guide me, weither i can use .net 4.5 dll on autocad 2012.

 

Regards,

Raman

5 REPLIES 5
Message 2 of 6
norman.yuan
in reply to: RamanSBV

Have you give it a try?

 

Here is what I tried with my Acad2012 and VS2012 (C# or VB.NET, should not matter):

 

1. Created a DLL project against .NET4.5, added reference to Acad2012's acdbmgd.dll/acmgd.dll; Set debugging to start Acad.exe

2. wrote some simple acad code in a command method, like

    Editor.WriteMessage("\nHello World!");

    LayoutManager.Current.CurrentLayout="Layout1";

    Also some simple code in IExtensionApplication.Initialize(), such as Editor.WriteMessage(.....);

3. Start debugging. Then I got exception...

4. Go to VS2012->Menu->Degub->Exceptions..., in "Managed Debugging Assistants", uncheck "Thrown" on item "LoaderLock". Click OK. Start debugging again.

5. In Acad2012, netload the .NET4.5 dLL. the code in IExtensionApplication.Initialize() runs OK, because the command line shows the message.

6. Issue the command, the layout "Layout1" is then set to current correctly.

 

That is, at least, .NET4.5 code can run in Acad2012 configured to use .NET4.0 (i.e. in acad.exe.config, there is default item <supportedRuntime version="v4.0"/> in the <startup /> section. However, if I change "v4.0" to "v4.5", AutoCAD 2012 startup crashes. If I comment out <supportedRuntime...> (so that acad2012 uses .NET2/3.5 by default), then NETLOADing .NET4.5 dll will cause exception.

 

With all siad, my test was very limited. simple code running may not mean one does not get problem from more complicated development. More importantly, if any problem emerges, I am sure Autodesk would not provide support on this. So, unless my development must use something only available with .NET 4.5 and I am willing to take the risk, there is no point to try my luck with acad2012+.NET4.5. So far .NET4.0 is good enough.

Message 3 of 6
khoa.ho
in reply to: RamanSBV

I did a quick test with Visual Studio 2012 to create a class project using .NET 4.5, reference AutoCAD 2013 DLL files, and it WORKS!

 

It is very interesting that we can use the latest VS and .NET 4.5 to build plug-ins for AutoCAD 2013. I don't know if it will work with AutoCAD 2012 or not.

 

See the attachment for the sample project (requires VS 2012 and A2013).

 

-Khoa

Message 4 of 6
fxcastil
in reply to: RamanSBV

 

Which Edition of Microsoft Visual Studio to Use

Microsoft Visual Studio is available in multiple versions and editions. To use the .NET API for AutoCAD 2012, you need to use:

  • Microsoft Visual Studio 2010
  • Microsoft .NET Framework 4.0

http://exchange.autodesk.com/autocadarchitecture/enu/online-help/ARCHDESK/2012/ENU/pages/WS73099cc14...

Message 5 of 6
RamanSBV
in reply to: fxcastil

Hi,

 

I am using Microsoft Visual Studio 2010. With .Net Framework 4.5

 

app.Config :

<?xmlversion="1.0"?>

<configuration>

    <startup>

    <supportedRuntimeversion="v4.0"

    sku=".NETFramework,Version=v4.5"/>

    </startup>

</configuration>

 

Regards,

Raman

Message 6 of 6
norman.yuan
in reply to: RamanSBV


@RamanSBV wrote:

Hi,

 

I am using Microsoft Visual Studio 2010. With .Net Framework 4.5

 

app.Config :

<?xmlversion="1.0"?>

<configuration>

    <startup>

    <supportedRuntimeversion="v4.0"

    sku=".NETFramework,Version=v4.5"/>

    </startup>

</configuration>

 

Regards,

Raman


You are kidding, aren't you? How could you use VS2010 with .NET4.5?

 

Do you write code in VS2010 and then manually use .NET4.5 comiler to compile the code into DLL? Why not use VS2012?

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