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

Conflict when aliasing an Autodesk namespace

6 REPLIES 6
Reply
Message 1 of 7
jbooth
524 Views, 6 Replies

Conflict when aliasing an Autodesk namespace

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
6 REPLIES 6
Message 2 of 7
Anonymous
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
Message 3 of 7
jbooth
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.
Message 4 of 7
jbooth
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.
Message 5 of 7
jbooth
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
Message 6 of 7
Anonymous
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
Message 7 of 7
jbooth
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

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