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

'ApplicationServices' is not a member of 'AutoCAD'

13 REPLIES 13
Reply
Message 1 of 14
RyanBotha
648 Views, 13 Replies

'ApplicationServices' is not a member of 'AutoCAD'

Hello,

 

First off, you may have seen this before here...

http://forums.autodesk.com/t5/NET/Namespace-ApplicationServices-does-not-exist-in-Autodesk-AutoCAD/t...

 

However, that does work for me, not sure why. I'm using VB 2010 Express, and really enjoying it! When I add my references, acdbmgd and acmgd from AutoCAD 2012 folder, everything looks good. When I hit compile, i get the errors shown in the attachment.

errors.jpg

What have I done wrong?

Thank you for your help.

 

Regards & Happy Easter

Ryan

 

13 REPLIES 13
Message 2 of 14
adadnet
in reply to: RyanBotha

hi ryan, just an idea, have you tried setting the reference path of the acmgd file to the downloaded, appropriate sdk folder (as opposed to the autodesk one)?

Message 3 of 14
RyanBotha
in reply to: adadnet

Hi,

 

I had tried that, but to make sure, I tried it again, with not success. If I'm correct in understanding you, its the one that defaults to C:\ObjectARX 2012\inc

 

I also ran a repair on .NET framework 4., and ran the 3.5 SP1 install too. Nothing changed.

 

Hmmm, what now?

Message 4 of 14
RyanBotha
in reply to: RyanBotha

So, I found the advanced compiler options! It was set to '.NET 4 Framework Client Profile'. If I change it to .'NET Framework 4', it compiles, but doesn't run.

 

Advanced Compiler Settings.jpg

 

Error is thrown before form appears.

 

running error.jpg

Message 5 of 14
adadnet
in reply to: RyanBotha

does acad2012 know that you are now targeting .net 4.0? i.e. have you allocated the acad configuration file on your system and changed version to 4.0?

Message 6 of 14
RyanBotha
in reply to: adadnet

I'm a bit rusty. And to be honest, have no idea what you just asked me Smiley Indifferent

 

How would I do that last bit. Apologies for the greeness! 😛

Message 7 of 14
adadnet
in reply to: RyanBotha

sorry, was a bit short.

 

on your main drive should be the autodesk file for your acad application and in there an acad configuration file (either .exe or .config). this config file contains the acad's target .net framework (and not much more) which should conform to the framework you set for you project, as you say 4.0 (and not be commented out); you can open and edit the config file e.g. with notepad

Message 8 of 14
RyanBotha
in reply to: adadnet

No Problem!

 

<configuration>

   <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0"/>
   </startup>

 

<!--All assemblies in AutoCAD are fully trusted so there's no point generating publisher evidence-->
   <runtime>
      <generatePublisherEvidence enabled="false"/>
   </runtime>
</configuration>

 

This is in a file called acad.exe.config. Presuming that is v4.0...

 

I'm runnning Win7 x64 if that makes a difference...

Message 9 of 14
adadnet
in reply to: RyanBotha

i'm stuck. recap: applicationservices namespace found after project's target framework set to 4.0; acad config file also 4.0; project compiles;

 

"...but doesn't run"- you start debugging but no feedback in the immediate window, hit breakpoints, any exceptions thrown etc?

Message 10 of 14
adadnet
in reply to: RyanBotha
Message 11 of 14
RyanBotha
in reply to: adadnet

Yeah, I am aware of the 'MyFirstPlugin'. I'll try compile on my home laptop, and see if its a machine issue. If not, I'll post a recap.

 

Thank you for your help!

Message 12 of 14
norman.yuan
in reply to: RyanBotha

The fact that it compiles but does not run, and the other clues from what you have sid in this thread inducate that your have an issue that is different from the other thread you mentioned:

 

You are doing a stand-alone VB.NET EXE project, aren't you?

 

If yes, then you CANNOT USE AutoCAD .NET API assemblies (acdbmgd.dll, acmgd.dll...), thus the error you got when trying to run your app.

 

For EXE app, you can only use AutoCAD COM API, or you can do Acad .NET API DLL project and expose it as COM (if you know what does that mean).

Message 13 of 14
RyanBotha
in reply to: norman.yuan

Norman, I think you've got it! I neglected to mention that its a standalone app, mostly incororating Excel to Inventor communication. I'm using the AutoCAD bit to update a title block.

 

Yikes, the smallest things get overlooked. Didn't even think to mention it.

 



@norman.yuan wrote:

For EXE app, you can only use AutoCAD COM API, or you can do Acad .NET API DLL project and expose it as COM (if you know what does that mean).



I've got a vague idea of what you mean. Any links that I can follow or read though to guide me through it? 

 

Thank you!

Message 14 of 14
RyanBotha
in reply to: norman.yuan

Appreciate the help and patience. I think I've stumbled upon the potential answer within AutoCAD Exchange. Just never knew what to search for. Case of 'you don't know what you don't know'. Thats why the forum is so helpful

 Smiley Happy

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