Hi,
Please guide me, weither i can use .net 4.5 dll on autocad 2012.
Regards,
Raman
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.
Norman Yuan
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
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:
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
@Anonymous 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?
Norman Yuan
Can't find what you're looking for? Ask the community or share your knowledge.