Using Shared Classes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sylvie

    Using Shared Classes

    Hello,

    I have a web application and windows application,

    My web application has App_Code folder and in this folder have a Users.cs
    file, this file has some user management classes and routines,

    The problem is, when I try to use this class from windows application and
    want to add these classes to my app. Vs.2005 copies these classes to windows
    application folder, it means, it duplicates these users.cs file

    I want to use first Users.cs as a reference, How can It be ?

    Thanks


  • Jon Skeet [C# MVP]

    #2
    Re: Using Shared Classes

    On Nov 2, 11:01 am, "Sylvie" <s...@sss.sswro te:
    I have a web application and windows application,
    >
    My web application has App_Code folder and in this folder have a Users.cs
    file, this file has some user management classes and routines,
    >
    The problem is, when I try to use this class from windows application and
    want to add these classes to my app. Vs.2005 copies these classes to windows
    application folder, it means, it duplicates these users.cs file
    >
    I want to use first Users.cs as a reference, How can It be ?
    Create a class library containing the common code, and reference it
    from both projects.

    Jon

    Comment

    • Rene

      #3
      Re: Using Shared Classes

      If you are using a source control program, you may be able to share the
      files between the two projects. I think in Visual Source Safe this is called
      "Share file".


      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: Using Shared Classes

        On Nov 2, 1:12 pm, "Rene" <a...@b.comwrot e:
        If you are using a source control program, you may be able to share the
        files between the two projects. I think in Visual Source Safe this is called
        "Share file".
        That's a really bad solution to the problem though - using a class
        library is a solution specifically designed for this very problem.

        Jon

        Comment

        • T.J. Thornbrook

          #5
          Re: Using Shared Classes

          "Jon Skeet [C# MVP]" <skeet@pobox.co mwrote in message
          news:1194005465 .226609.157470@ k79g2000hse.goo glegroups.com.. .
          On Nov 2, 11:01 am, "Sylvie" <s...@sss.sswro te:
          >I have a web application and windows application,
          >>
          >My web application has App_Code folder and in this folder have a Users.cs
          >file, this file has some user management classes and routines,
          >>
          >The problem is, when I try to use this class from windows application and
          >want to add these classes to my app. Vs.2005 copies these classes to
          >windows
          >application folder, it means, it duplicates these users.cs file
          >>
          >I want to use first Users.cs as a reference, How can It be ?
          >
          Create a class library containing the common code, and reference it
          from both projects.
          Then you have the dll in two places.


          Comment

          • Jon Skeet [C# MVP]

            #6
            Re: Using Shared Classes

            T.J. Thornbrook <tj@workdrinkin gdietpepsi.comw rote:
            Create a class library containing the common code, and reference it
            from both projects.
            >
            Then you have the dll in two places.
            You have the "original" DLL in one place, and then building the other
            applications copies the DLL. There's no harm in that, IMO.

            --
            Jon Skeet - <skeet@pobox.co m>
            http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
            If replying to the group, please do not mail me too

            Comment

            • Sylvie

              #7
              Re: Using Shared Classes

              I ll try Class Library

              Thanks


              "Jon Skeet [C# MVP]" <skeet@pobox.co m>, iletide sunu yazdi
              news:MPG.219592 4074a7351c5bd@m snews.microsoft .com...
              T.J. Thornbrook <tj@workdrinkin gdietpepsi.comw rote:
              Create a class library containing the common code, and reference it
              from both projects.
              >>
              >Then you have the dll in two places.
              >
              You have the "original" DLL in one place, and then building the other
              applications copies the DLL. There's no harm in that, IMO.
              >
              --
              Jon Skeet - <skeet@pobox.co m>
              http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
              If replying to the group, please do not mail me too

              Comment

              Working...