.NET

.NET

Reply
Valued Contributor
RyanBotha
Posts: 98
Registered: ‎01-15-2007
Message 1 of 14 (257 Views)

'ApplicationServices' is not a member of 'AutoCAD'

257 Views, 13 Replies
04-05-2012 02:22 AM

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

 

Valued Contributor
FFlix
Posts: 95
Registered: ‎11-15-2011
Message 2 of 14 (249 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 03:11 AM 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)?

Valued Contributor
RyanBotha
Posts: 98
Registered: ‎01-15-2007
Message 3 of 14 (247 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 03:23 AM in reply to: FFlix

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?

Valued Contributor
RyanBotha
Posts: 98
Registered: ‎01-15-2007
Message 4 of 14 (242 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 03:39 AM 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

Valued Contributor
FFlix
Posts: 95
Registered: ‎11-15-2011
Message 5 of 14 (235 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 03:47 AM 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?

Valued Contributor
RyanBotha
Posts: 98
Registered: ‎01-15-2007
Message 6 of 14 (233 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 03:51 AM in reply to: FFlix

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

 

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

Valued Contributor
FFlix
Posts: 95
Registered: ‎11-15-2011
Message 7 of 14 (229 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 04:15 AM 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

Valued Contributor
RyanBotha
Posts: 98
Registered: ‎01-15-2007
Message 8 of 14 (222 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 05:18 AM in reply to: FFlix

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...

Valued Contributor
FFlix
Posts: 95
Registered: ‎11-15-2011
Message 9 of 14 (217 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 05:36 AM 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?

Valued Contributor
FFlix
Posts: 95
Registered: ‎11-15-2011
Message 10 of 14 (210 Views)

Re: 'ApplicationServices' is not a member of 'AutoCAD'

04-05-2012 05:46 AM in reply to: RyanBotha
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.