.NET

.NET

Reply
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 1 of 7 (310 Views)

Conflict when aliasing an Autodesk namespace

310 Views, 6 Replies
09-21-2009 01:28 PM
After upgrading to the 2010 libraries, using the following code:

{code}Imports AcDb = Autodesk.AutoCAD.DatabaseServices{code}

Generates the following compiler error:

{code}Imports alias 'AcDb' conflicts with 'Structure AcDb' declared in the root namespace.{code}

I did not have this problem when referencing the old libraries (2008/R17.1). I'm currently using the alias AcDb2, which works - although I would prefer to use something more consistent with Autodesk's naming convention.

Could someone confirm that this is an issue, and if so, if anyone here found a way around it, aside from using an alternate alias?

Regards,
JB
*Tony Tanzillo
Message 2 of 7 (310 Views)

Re: Conflict when aliasing an Autodesk namespace

09-22-2009 04:51 AM in reply to: jbooth
It may have something to do with your project, because
I can't repro that in C#.

AcDb is a native struct that's defined at the module-level
but it has internal scope, so it should not be visible to your
code.

Are you by chance using the Autodesk wizard?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6257888@discussion.autodesk.com...
After upgrading to the 2010 libraries, using the following code:

{code}Imports AcDb = Autodesk.AutoCAD.DatabaseServices{code}

Generates the following compiler error:

{code}Imports alias 'AcDb' conflicts with 'Structure AcDb' declared in the
root namespace.{code}

I did not have this problem when referencing the old libraries (2008/R17.1).
I'm currently using the alias AcDb2, which works - although I would prefer
to use something more consistent with Autodesk's naming convention.

Could someone confirm that this is an issue, and if so, if anyone here found
a way around it, aside from using an alternate alias?

Regards,
JB
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 3 of 7 (310 Views)

Re: Conflict when aliasing an Autodesk namespace

09-22-2009 07:27 AM in reply to: jbooth
No I did not use the wizard. This is a project built from scratch, referencing acdbmgd.dll, acmgd.dll, adwindows.dll, and the 2010 COM library.
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 4 of 7 (310 Views)

Re: Conflict when aliasing an Autodesk namespace

09-22-2009 07:31 AM in reply to: jbooth
Update: I just tried to create a new blank project (dll file) and added only references to acdbmgd and acmgd.

Same problem. However I think I have an idea as to what's going on. I'm using Visual Studio 2005.
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 5 of 7 (310 Views)

Re: Conflict when aliasing an Autodesk namespace

11-19-2009 09:15 AM in reply to: jbooth
Second update:

I downloaded the vs2010 beta and this problem still occurs, even when running on the .NET 4.0 framework. However, as Tony suggested, I created a C# project and it works fine.

So in conclusion, VB.NET does not work, and C# does. Has anyone else had this problem?

Regards,
JB
*tp
Message 6 of 7 (310 Views)

Re: Conflict when aliasing an Autodesk namespace

12-16-2009 05:05 AM in reply to: jbooth
Acdb exchange for something else.
For example: aaDb = Autodesk.AutoCAD.DatabaseServices
tp



"jbooth" escreveu na mensagem news:6257888@discussion.autodesk.com...
After upgrading to the 2010 libraries, using the following code:

{code}Imports AcDb = Autodesk.AutoCAD.DatabaseServices{code}

Generates the following compiler error:

{code}Imports alias 'AcDb' conflicts with 'Structure AcDb' declared in the
root namespace.{code}

I did not have this problem when referencing the old libraries (2008/R17.1).
I'm currently using the alias AcDb2, which works - although I would prefer
to use something more consistent with Autodesk's naming convention.

Could someone confirm that this is an issue, and if so, if anyone here found
a way around it, aside from using an alternate alias?

Regards,
JB
Distinguished Contributor
jbooth
Posts: 223
Registered: ‎02-17-2006
Message 7 of 7 (310 Views)

Re: Conflict when aliasing an Autodesk namespace

12-16-2009 07:27 AM in reply to: jbooth
I already made it clear in my first post that using an alternate alias is not an answer I was looking for.

Thanks though,
JB
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.