Another thing you can do is use binding redirect in acad.exe.config.
1. Build against the R2005 version of the interop assemblies.
2. Add the following to acad.exe.config on R2006. I haven't tried this so I
may have some silly typos. It shows the idea nonetheless:
publicKeyToken="eed84259d7cbf30b" culture="neutral" />
And yet another solution is to use your own interop assembly (based on say
the R2004 version of the typelib). You don't have to use the PIA. Using your
own interop assembly will make you redistributable bigger but it will work
for R2004, 2005, 2006.
wrote in message news:firstname.lastname@example.org...
The interop assembly being provided by Autodesk and going through activex
interfaces creates a unique problem.
I can only build for one version at a time, if I have 2006 installed and
write a .net app for Autocad, it will not run on a system with only 2005
To solve this and be able to build for both 2005 and 2006, I had to build a
batch file that unregisters the 2006 interop and registers the 2005 one
Not a major issue, but it adds an extra complicated step that dot net is
supposed to eliminate.
Yep. This may break other R2006 based apps that rely on R2006-only features.
wrote in message news:email@example.com...
That could break other applications or introduce old framework bugs into
R2006 itself. I have to remain interoperable with other plugins for ADT.
Sure, the first two steps you will have to do manually to setup for your compiles/builds.
1) Locate the Autodesk .dll files in the GAC. You cannot use windows explorer for this, you have to use the good old command line with cd and dir.
xcopy *.* c:\temp\junk /S
This will copy all the subdirs and all dlls in the gac so you can get at them with explorer.
2) Find the appropriate Autodesk folders and copy the dlls to a nice location for your builds for ease of use.You will need a folder for each version.
Now that we have the dotnet dlls you can now setup for builds.
Assuming we are building the 2006 version of the program:
3) Execute the unregister batch file for 2005 (shown below)
%Framework%\regasm Autodesk.AEC.Interop.ArchBase.dll /u
%Framework%\regasm Autodesk.AEC.Interop.Base.dll /u
%Framework%\regasm Autodesk.AEC.Interop.UIArchBase.dll /u
%Framework%\regasm Autodesk.AEC.Interop.UIBase.dll /u
%Framework%\regasm Autodesk.AutoCAD.Interop.dll /u
%Framework%\regasm Autodesk.AutoCAD.Interop.Common.dll /u
if (%1)==(AUTO) goto :EOF
4) Execute the register batch file for 2006 (shown below)
if (%1)==(AUTO) goto :EOF
There are 4 batch files, reg and unreg for 2005, reg and unreg for 2006. Thist allows a developer to be on 2006 and we can build for both versions (as long as he doesn't use any 2006 only features).