Loading ...
Sorry, an error occurred while loading the content.

RE: [vsnetaddin] Re: ProjectItem.Open() problem with linked files

Expand Messages
  • Quintero Vivar, Carlos Javier
    If you create a new project, you link an existing .cs file and you save the project, the .csproj file includes de Subtype= Code :
    Message 1 of 16 , Dec 1, 2004
    • 0 Attachment
      If you create a new project, you link an existing .cs file and you save the
      project, the .csproj file includes de Subtype="Code":

      <Files>
      <Include>
      <File
      RelPath = "Class1.cs"
      SubType = "Code"
      BuildAction = "Compile"
      />
      <File
      RelPath = "CommonClass.cs"
      Link = "..\CommonClass.cs"
      SubType = "Code"
      BuildAction = "Compile"
      />
      </Include>
      </Files>

      So, which are the steps to reproduce your case?

      Best regards,

      Carlos J. Quintero

      MZ-Tools 4.0, now for VS.NET: www.mztools.com


      _____

      De: USysWare [mailto:usysware@...]
      Enviado el: martes, 30 de noviembre de 2004 18:57
      Para: vsnetaddin@yahoogroups.com
      Asunto: [vsnetaddin] Re: ProjectItem.Open() problem with linked files



      There is one issue I see with this approach though. Just like in the
      test case, suppose I have a newly created C# solution/project with a
      linked file. Checking the .csproj file I see that linked file
      project entry doesn't have its SubType property (tag in the project)
      set. Therefore my add-in would treat a linked .cs file as non-code
      file. I'm not sure how to work around that.

      Thanks again for your help.

      Internet Email Confidentiality Footer
      Este mensaje y cualquier fichero adjunto esta dirigido unicamente a sus destinatarios y pueden contener informacion confidencial. Si usted considera que ha recibido este correo electronico por error (por asunto, por remitente o por cualquier otra causa), le informamos que cualquier revision, alteracion, impresion, copia o transmision de este mensaje o de cualquier fichero adjunto esta prohibida y puede constituir un acto ilegal. Por favor, notifiquele el error al remitente respondiendo a este e-mail y elimine el mensaje y su contenido inmediatamente.


      This e-mail and any files transmitted with it are intended solely for the use of the intended recipients and may contain confidential information. If it appears (from the subject matter or address information or otherwise) that you received this email in error, please note that any review, dissemination, disclosure, alteration, printing, copying or transmission of this e-mail or any file transmitted with it is prohibited with is prohibited and may be unlawful. Please notify us by return e mail and delete this email and its contents immediately.


      [Non-text portions of this message have been removed]
    • USysWare
      I can easily create a brand new project with a linked file where .csproj file would not have SubType entry. I could basically: * create a new library * remove
      Message 2 of 16 , Dec 1, 2004
      • 0 Attachment
        I can easily create a brand new project with a linked file
        where .csproj file would not have SubType entry. I could basically:

        * create a new library
        * remove the AssemblyInfo.cs from the project
        * close the project (sometimes have to restart VS.NET)
        * move the file one folder up
        * reopen the project
        * and that file as a linked one
        * save the project

        In any case, not having SubType on *some* linked files out of all of
        the files in an acceptable condition. It's still way better than
        getting a COM exception and then having IDE messed up so that it has
        to be restarted. I can live with this. Thanks for all of your help.



        --- In vsnetaddin@yahoogroups.com, "Quintero Vivar, Carlos Javier"
        <carlosq@s...> wrote:
        > If you create a new project, you link an existing .cs file and you
        save the
        > project, the .csproj file includes de Subtype="Code":
        >
        > <Files>
        > <Include>
        > <File
        > RelPath = "Class1.cs"
        > SubType = "Code"
        > BuildAction = "Compile"
        > />
        > <File
        > RelPath = "CommonClass.cs"
        > Link = "..\CommonClass.cs"
        > SubType = "Code"
        > BuildAction = "Compile"
        > />
        > </Include>
        > </Files>
        >
        > So, which are the steps to reproduce your case?
        >
        > Best regards,
      • Quintero Vivar, Carlos Javier
        I have tried to reproduce it with those steps to no avail. Anyway, for those cases when you get an empty Subtype, you can check the extension of the file. If
        Message 3 of 16 , Dec 2, 2004
        • 0 Attachment
          I have tried to reproduce it with those steps to no avail. Anyway, for those
          cases when you get an empty Subtype, you can check the extension of the
          file. If it is ".vb" or ".cs" I think you can assume that it is a file with
          code. The Subtype property is intended to distinguish the type of code,
          seeing if the class inherits from Form, etc. which is far beyond what you
          need.

          Best regards,

          Carlos J. Quintero

          MZ-Tools 4.0, now for VS.NET: www.mztools.com

          _____

          De: USysWare [mailto:usysware@...]
          Enviado el: miƩrcoles, 01 de diciembre de 2004 16:30
          Para: vsnetaddin@yahoogroups.com
          Asunto: [vsnetaddin] Re: ProjectItem.Open() problem with linked files



          I can easily create a brand new project with a linked file
          where .csproj file would not have SubType entry. I could basically:

          * create a new library
          * remove the AssemblyInfo.cs from the project
          * close the project (sometimes have to restart VS.NET)
          * move the file one folder up
          * reopen the project
          * and that file as a linked one
          * save the project

          In any case, not having SubType on *some* linked files out of all of
          the files in an acceptable condition. It's still way better than
          getting a COM exception and then having IDE messed up so that it has
          to be restarted. I can live with this. Thanks for all of your help.


          Internet Email Confidentiality footer Este mensaje y cualquier fichero adjunto esta dirigido unicamente a sus destinatarios y pueden contener informacion confidencial. Si usted considera que ha recibido este correo electronico por error (por asunto, por remitente o por cualquier otra causa), le informamos que cualquier revision, alteracion, impresion copia o transmision de este mensaje o de cualquier fichero adjunto esta prohibida y puede constituir un acto ilegal. Por favor, notifiquele el error al remitente respondiendo a este e-mail y elimine el mensaje y su contenido inmediatamente.


          This e-mail and any files transmitted with it are intended soley for the use of the intended recipients and may contain confidential information. If it appears (from the subject matter or address information or otherwise) that you received this email in error, please note that any review, dissemination, disclosure, alteration, printing, copying or transmission of this e-mail or any file transmitted winth it is prohibited and may be unlawful. Please notify us by return email and delete this email and its contents immediately.


          [Non-text portions of this message have been removed]
        • USysWare
          I was just able to reproduce it. File|New|C# Windows Forms Application. Save and close the solution. Examine the C# project file. AssemblyInfo.cs file entry
          Message 4 of 16 , Dec 16, 2004
          • 0 Attachment
            I was just able to reproduce it. File|New|C# Windows Forms
            Application. Save and close the solution. Examine the C# project
            file. AssemblyInfo.cs file entry does not have its SubType set.



            --- In vsnetaddin@yahoogroups.com, "Quintero Vivar, Carlos Javier"
            <carlosq@s...> wrote:
            > I have tried to reproduce it with those steps to no avail. Anyway,
            for those
            > cases when you get an empty Subtype, you can check the extension
            of the
            > file. If it is ".vb" or ".cs" I think you can assume that it is a
            file with
            > code. The Subtype property is intended to distinguish the type of
            code,
            > seeing if the class inherits from Form, etc. which is far beyond
            what you
            > need.
            >
            > Best regards,
            >
            > Carlos J. Quintero
            >
            > MZ-Tools 4.0, now for VS.NET: www.mztools.com
            >
            > _____
            >
            > De: USysWare [mailto:usysware@y...]
            > Enviado el: miƩrcoles, 01 de diciembre de 2004 16:30
            > Para: vsnetaddin@yahoogroups.com
            > Asunto: [vsnetaddin] Re: ProjectItem.Open() problem with linked
            files
            >
            >
            >
            > I can easily create a brand new project with a linked file
            > where .csproj file would not have SubType entry. I could basically:
            >
            > * create a new library
            > * remove the AssemblyInfo.cs from the project
            > * close the project (sometimes have to restart VS.NET)
            > * move the file one folder up
            > * reopen the project
            > * and that file as a linked one
            > * save the project
            >
            > In any case, not having SubType on *some* linked files out of all
            of
            > the files in an acceptable condition. It's still way better than
            > getting a COM exception and then having IDE messed up so that it
            has
            > to be restarted. I can live with this. Thanks for all of your help.
            >
            >
            > Internet Email Confidentiality
            footer Este mensaje y cualquier fichero
            adjunto esta dirigido unicamente a sus destinatarios y pueden
            contener informacion confidencial. Si usted considera que ha
            recibido este correo electronico por error (por asunto, por
            remitente o por cualquier otra causa), le informamos que cualquier
            revision, alteracion, impresion copia o transmision de este mensaje
            o de cualquier fichero adjunto esta prohibida y puede constituir un
            acto ilegal. Por favor, notifiquele el error al remitente
            respondiendo a este e-mail y elimine el mensaje y su contenido
            inmediatamente.
            >
            >
            > This e-mail and any files transmitted with it are intended soley
            for the use of the intended recipients and may contain confidential
            information. If it appears (from the subject matter or address
            information or otherwise) that you received this email in error,
            please note that any review, dissemination, disclosure, alteration,
            printing, copying or transmission of this e-mail or any file
            transmitted winth it is prohibited and may be unlawful. Please
            notify us by return email and delete this email and its contents
            immediately.
            >
            >
            > [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.