Bug Report T433271
Visible to All Users

Templates do not support namespace aliases

created 8 years ago

Trying to setup a template with Dependent Namespaces.  It seems that the functionality does not take into account Namespace Aliases.  It just keeps adding more entries in code file each time template is executed.

using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;
using AcAp = Autodesk.AutoCAD.ApplicationServices;
using AcCm = Autodesk.AutoCAD.Colors;
using AcDb = Autodesk.AutoCAD.DatabaseServices;
using AcEd = Autodesk.AutoCAD.EditorInput;
using AcGe = Autodesk.AutoCAD.Geometry;
using AcGi = Autodesk.AutoCAD.GraphicsInterface;
using AcLy = Autodesk.AutoCAD.LayerManager;
using AcPl = Autodesk.AutoCAD.PlottingServices;
using AcRx = Autodesk.AutoCAD.Runtime;
using AcWi = Autodesk.AutoCAD.Windows;

I heavily use aliases to help prevent namespace clashes.  When I issue a template with Dependent Namespaces, I get duplicated namespace references because CodeRush isn't seeing the existing references due to aliases.

Comments (3)
DevExpress Support Team 8 years ago

    Hello,

    Thank you for pointing out this issue.

    Regarding CodeRush for Roslyn, it does not add a new using on my side. However, it also does not use the existing alias and as a result produces non-compilable code.
    I have attached a screencast that illustrates the behavior on my side. I have created a separate ticket for this: CodeRush for Roslyn does not use existing alias for dependent namespaces when expanding a template.

    Would you provide with us a screencast that illustrates the behavior on your side? You can capture it using a free Jing tool from TechSmith.

    We look forward to your response.

    R R
    Ronnie Wilkins Jr 8 years ago

      Here is a screen cast showing templates without dependent namespace and with dependent namespace

      DevExpress Support Team 8 years ago

        Hello Ronnie,

        Thank you for providing the screencast.

        We agree that we should not add the same using statement with an alias in this case.

        We will research this issue and notify you as soon as we make any progress.

        Answers approved by DevExpress Support

        created 8 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.