muck Posted March 4, 2012 Share Posted March 4, 2012 Subject: Making Vb.net projects portable on 64 & 32 bit machines. Programs: AutoCAD 2010, VS 2008 and SharpDevelop 3.0 Visual Basic Editor. I am just starting VB.net with AutoCAD. I am wondering if it is possable to put my projects on an external USB drive and use them on my 32 bit machine at home and my new 64 bit machine at work. When I installed VS 2008 on my 32 bit machine at home I noticed that there is a 64 bit option. I have not installed VS 2008 on the 64 bit machine so I don't know what I am going to run into at this point. Instead of using Microsoft VS 2008, I have used SharpDevelop 3.0 to run VB projects on my work machine. I like SharpDevelop 3.0 because you do not have to install it on your computer. With modifications, you can place SharpDevelop 3.0 on a USB drive and run from there. I had a little success getting my VB projects to run with AutoCAD but I am using SharpDevelop 3.0 instead of Mircosoft Visual Studio 2008. It is difficult to me follow VB.net tutorials with Develop Sharp 3.0 because they use Microsoft Visual Studio. The reason I want to use SharpDevelp 3.0 instead of MS Visual Studio is I don't have to install VS on my work computer. Any suggestions on how to make my projects portable? Thank you, Quote Link to comment Share on other sites More sharing options...
Tyke Posted March 5, 2012 Share Posted March 5, 2012 In the project properties compile tab select "any cpu" for the platform and your project will run on both 32 and 64 bit systems. Quote Link to comment Share on other sites More sharing options...
muck Posted March 5, 2012 Author Share Posted March 5, 2012 My platform is set for "Any Cpu" I had a good run on my 32 bit machine but when I go to the 64 bit machine I get errors. On the 32 bit machine I am using AutoCAD 2010. On the 64 bit machine I am using AutoCAD 2010. I think it is having problems loading the acdmgd.dll and asmgd.dll files. Any suggestions to solve this problem? Thank you, Quote Link to comment Share on other sites More sharing options...
Tyke Posted March 6, 2012 Share Posted March 6, 2012 Not come across that one before. Try renaming the two dlls and then replacing them using the repair option from the installations DVD. I somestimes get an issue if all of the references or resources are not the same on the two computers, but otherwise all of my .NET projects run without a hitch on 32 and 64 bit machines. Quote Link to comment Share on other sites More sharing options...
SEANT Posted March 6, 2012 Share Posted March 6, 2012 This query has a couple of variable that could make a definitive answer rather difficult - SharpDevelop/VS, 32bit/64bit. Isolating one variable at a time may help pinpoint the problem. Start a new project, something fairly basic, but only use SharpDevelop. Use that to debug on both machines. I know I ran into a couple of 32bit/64bit issues when developing for AutoCAD 2009. Some of those issues may still exist in 2010 and, conceivably, will be easier to discover if the SharpDevelop/VS compatibility is removed as a potential problem area. It may be quite possible to use both IDEs to develop one project, but I wouldn’t attempt it until I had the project working pretty well in one of them. Quote Link to comment Share on other sites More sharing options...
SEANT Posted March 6, 2012 Share Posted March 6, 2012 With regard to acdmgd.dll and asmgd.dll compatibility: How are these two dll referenced? It is advisable to download and install the appropriate ObjectARX SDK and have that available on any computer used for development. Instead of referencing C:\Program Files\Autodesk\AutoCAD 2010\acdbmgd.dll (for instance) the project should reference . . . \ObjectARX 2010\inc\AcDbMgd.dll Quote Link to comment Share on other sites More sharing options...
muck Posted March 6, 2012 Author Share Posted March 6, 2012 (edited) I think both acdmgd.dll and asmgd.dll are path dependent. One thing I would like to know is acdmgd.dll and asmgd.dll exist for differ versions. So is there acdmgd.dll and asmgd.dll for 32 bit machines and different acdmgd.dll and asmgd.dll for 64 bit machines. If so I guess there these files are not interchangable. So it is best to use install ObjectARX 2010 for both machines and referance acdmgd.dll and asmgd.dll files from that package? The 64 bit machine has 2012 on it. So will the ObjectARX 2010 work for it? Another think to consider, does Netframework versions have to be the same? Thank you, Edited March 6, 2012 by muck Quote Link to comment Share on other sites More sharing options...
SEANT Posted March 6, 2012 Share Posted March 6, 2012 Yes, the 64bit and 32bit versions of acdmgd.dll and asmgd.dll would be different. One of the benefits of using those files from ObjectARX 2010\inc is that the references for the netloaded DLL will automatically be directed to the correct location. I think the eventual game plan is that .NET routine will run on either 64- or 32 bit without any extra effort from the programmer. Unfortunately, the .NET API is still fairly new and some (very few) incompatibilities do exist. Ideally, when developing for different releases of AutoCAD, you would target the .NET version applicable to the lowest version (that would be .NET 3.5 for AutoCAD 2010/2012 platforms). Quote Link to comment Share on other sites More sharing options...
muck Posted March 7, 2012 Author Share Posted March 7, 2012 Where is acdmgd.dll and asmgd.dll in the Obj 2012 ARX package for 64 bit? Where is acdmgd.dll and asmgd.dll in the Obj 2012 ARX package for 32 bit? I know the 2010 package will not work on the 2012 machine because of the path issue. Thank you, Quote Link to comment Share on other sites More sharing options...
SEANT Posted March 7, 2012 Share Posted March 7, 2012 Look in the ObjectARX 2010\inc folder. The files will have some capital letters: AcDbMgd.dll AcMgd.dll I installed the ObjectARX SDK directly on the C drive of both of the machines I use for development. One machine is Windows XP 32 Bit, the other Windows 7 64 bit. A Visual Studio solution file will have the references set to look in that location and, due to the similar directory structure, will find what it needs to allow development at either workstation. When the solution file is compiled (on either machine) the plugin will be pre-set to look in the appropriate location on the user's computer - at runtime - to find the actual acdbmgd.dll and asmgd.dll files. They will be in the same folder as acad.exe and the plugin will use whichever version it finds there. Quote Link to comment Share on other sites More sharing options...
muck Posted March 8, 2012 Author Share Posted March 8, 2012 So install ObjectARX 2010 on both machines and use it? Not the ObjectARX 2010 package. Thank you, Quote Link to comment Share on other sites More sharing options...
SEANT Posted March 8, 2012 Share Posted March 8, 2012 I’m not exactly sure what the distinction is between “ObjectARX 2010” and “ObjectARX 2010 package”. Nor am I sure how SharpDevelop compares with Visual Studio; I have only used VS. Your situation sounds rather unique. Due to limitations on what can and can’t loaded on a work machine, you are forced to use a roving development setup (Probably a tricky process that does not benefit from well documented procedures). Once you sort this all out you may become the resident expert on multi-machine policy-IDE-AutoCAD 32/64bit version- setups. Can you install ObjectARX_2010_Win_64_and_32Bit.exe on to the USB drive along side SharpDevelop? If so then setting the reference to point at USBDrive\ObjectARX 2010\inc may solve the issue rather nicely. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted March 8, 2012 Share Posted March 8, 2012 muck - I shared this with you (once?) before: Thinking more long-term, consider porting your code to VB.NET - You'll need Visual Studio 2010 (I use Express), the appropriate ObjectARX SDK(s), and I recommend you also use the current Wizard for properly debugging (when using Express). FWIW - I have no issues working on projects between Windows 7 32-Bit (home) & 64-Bit (work), especially when using Visual Studio Tools for Office (VSTO), given that I have full VS at home, and only Express on my work laptop. HTH Quote Link to comment Share on other sites More sharing options...
muck Posted March 8, 2012 Author Share Posted March 8, 2012 Well I got Sharp to run but it is giving the error "Project is configured as dll and no excution command is Specified". You can specify and execution command in project options? May be a question for Sharp Dev Forum. I would still like to get Sharp to work. Thank you, Quote Link to comment Share on other sites More sharing options...
Tyke Posted March 8, 2012 Share Posted March 8, 2012 You must define a command when writing your dll. Try using this to define your command: Imports Autodesk.AutoCAD.Runtime Public Class muckClass 'Define the command 'muckCommand' <CommandMethod("muckCommand")> _ Public Sub muckCommand() MsgBox("muckCommand") ' Type your code for the command here End Sub End Class Use 'netload' to load your dll and then type 'muckCommand' to get your new command to work. Don't forget you can't unload the dll, you have to restart AutoCAD. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.